viruspop

Simple autofeed for agma.io Press P to toggle.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

Advertisement:

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

Advertisement:

// ==UserScript==
// @name         viruspop
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Simple autofeed for agma.io  Press P to toggle.
// @match        *://agma.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let isAutofeeding = false;
    let feedInterval = null;
    const feedRate = 100; // milliseconds between feeds

    // Rainbow colors
    const rainbowColors = ['#FF0000', '#FF7F00', '#FFFF00', '#00FF00', '#0000FF', '#4B0082', '#9400D3'];
    let colorIndex = 0;

    // Create UI Container
    const uiContainer = document.createElement('div');
    uiContainer.id = 'agma-autofeed-ui';
    uiContainer.style.cssText = `
        position: fixed;
        top: 20px;
        right: 20px;
        width: 200px;
        background: linear-gradient(135deg, #FF0000, #FF7F00, #FFFF00, #00FF00, #0000FF, #4B0082, #9400D3);
        padding: 15px;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
        font-family: Arial, sans-serif;
        z-index: 10000;
        cursor: move;
        user-select: none;
        color: white;
        font-weight: bold;
    `;

    // Create Title
    const title = document.createElement('div');
    title.style.cssText = `
        text-align: center;
        font-size: 14px;
        margin-bottom: 10px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    `;
    title.textContent = 'AUTOFEED';

    // Create Status Display
    const statusDisplay = document.createElement('div');
    statusDisplay.id = 'agma-status';
    statusDisplay.style.cssText = `
        text-align: center;
        font-size: 13px;
        margin-bottom: 10px;
        padding: 8px;
        background: rgba(0,0,0,0.3);
        border-radius: 5px;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    `;
    statusDisplay.textContent = 'Status: OFF';

    // Create Toggle Button
    const toggleBtn = document.createElement('button');
    toggleBtn.style.cssText = `
        width: 100%;
        padding: 10px;
        background: rgba(255,255,255,0.9);
        color: #333;
        border: none;
        border-radius: 5px;
        font-weight: bold;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.3s;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    `;
    toggleBtn.textContent = 'START (P)';
    toggleBtn.onmouseover = () => toggleBtn.style.transform = 'scale(1.05)';
    toggleBtn.onmouseout = () => toggleBtn.style.transform = 'scale(1)';

    // Create Info Text
    const infoText = document.createElement('div');
    infoText.style.cssText = `
        text-align: center;
        font-size: 11px;
        margin-top: 10px;
        opacity: 0.9;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    `;
    infoText.textContent = 'Press P to toggle';

    uiContainer.appendChild(title);
    uiContainer.appendChild(statusDisplay);
    uiContainer.appendChild(toggleBtn);
    uiContainer.appendChild(infoText);
    document.body.appendChild(uiContainer);

    // Make UI draggable
    let isDragging = false;
    let dragOffsetX = 0;
    let dragOffsetY = 0;

    uiContainer.addEventListener('mousedown', (e) => {
        isDragging = true;
        dragOffsetX = e.clientX - uiContainer.offsetLeft;
        dragOffsetY = e.clientY - uiContainer.offsetTop;
    });

    document.addEventListener('mousemove', (e) => {
        if (isDragging) {
            uiContainer.style.left = (e.clientX - dragOffsetX) + 'px';
            uiContainer.style.right = 'auto';
            uiContainer.style.top = (e.clientY - dragOffsetY) + 'px';
        }
    });

    document.addEventListener('mouseup', () => {
        isDragging = false;
    });

    // Toggle animation
    function animateUI() {
        colorIndex = (colorIndex + 1) % rainbowColors.length;
        uiContainer.style.boxShadow = `0 0 25px ${rainbowColors[colorIndex]}`;
    }

    // Autofeed function
    function toggleAutofeed() {
        isAutofeeding = !isAutofeeding;

        if (isAutofeeding) {
            toggleBtn.textContent = 'STOP (P)';
            statusDisplay.textContent = 'Status: ON ✓';
            statusDisplay.style.background = 'rgba(0,255,0,0.3)';

            feedInterval = setInterval(() => {
                // Try different feeding methods
                const feedBtn = document.querySelector('[data-action="feed"]');
                if (feedBtn) feedBtn.click();

                // Or try spacebar
                const spaceEvent = new KeyboardEvent('keydown', {
                    key: ' ',
                    code: 'Space',
                    bubbles: true
                });
                document.dispatchEvent(spaceEvent);

                animateUI();
            }, feedRate);
        } else {
            toggleBtn.textContent = 'START (P)';
            statusDisplay.textContent = 'Status: OFF';
            statusDisplay.style.background = 'rgba(0,0,0,0.3)';

            clearInterval(feedInterval);
        }
    }

    // Button click handler
    toggleBtn.addEventListener('click', toggleAutofeed);

    // Keyboard shortcut (P key)
    document.addEventListener('keydown', (e) => {
        if (e.key.toLowerCase() === 'p') {
            toggleAutofeed();
        }
    });

    console.log('Agma.io Autofeed loaded! Press P to toggle.');
})();