Wormax.io - Bot + Zoom

Bot movimiento automatico + Zoom suave

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Wormax.io - Bot + Zoom
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Bot movimiento automatico + Zoom suave
// @author       You
// @match        *://*.wormax.io/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // ================================================
    // ZOOM (inyectado en contexto de pagina)
    // ================================================
    const zoomScript = document.createElement('script');
    zoomScript.textContent = '(' + function () {
        let zoomTarget   = 1.0;
        let zoomVelocity = 0.0;

        function findCameraController() {
            const stack = [window];
            const visited = new WeakSet();
            while (stack.length) {
                const obj = stack.pop();
                if (!obj || typeof obj !== 'object' || visited.has(obj)) continue;
                visited.add(obj);
                for (const key in obj) {
                    try {
                        const val = obj[key];
                        if (
                            val && typeof val === 'object' &&
                            val.camera && typeof val.camera.zoom === 'number' &&
                            'updateZoom' in val && 'follow' in val
                        ) return val;
                        if (val && typeof val === 'object') stack.push(val);
                    } catch {}
                }
            }
            return null;
        }

        function enforceZoom(camera) {
            let actualZoom = camera.zoom;
            (function loop() {
                const diff  = zoomTarget - actualZoom;
                zoomVelocity = diff * 0.15;
                actualZoom  += zoomVelocity;
                if (Math.abs(diff) < 0.0005) actualZoom = zoomTarget;
                camera.zoom = actualZoom;
                camera.update?.();
                requestAnimationFrame(loop);
            })();
        }

        function setupZoomInput() {
            window.addEventListener('wheel', (e) => {
                const step = e.altKey ? 0.1 : e.shiftKey ? 1.0 : 0.2;
                zoomTarget = Math.max(0.1, Math.min(5.0, zoomTarget + (e.deltaY > 0 ? step : -step)));
                e.preventDefault();
            }, { passive: false });

            document.addEventListener('keydown', (e) => {
                if (e.key.toLowerCase() === 'r') {
                    zoomTarget = 1.0;
                }
            });
        }

        function waitForCamera() {
            const iv = setInterval(() => {
                const ctrl = findCameraController();
                if (ctrl && ctrl.camera && typeof ctrl.camera.zoom === 'number') {
                    clearInterval(iv);
                    ctrl.updateZoom = false;
                    setupZoomInput();
                    enforceZoom(ctrl.camera);
                    console.log('[ZoomMod] Zoom activo');
                }
            }, 500);
        }

        waitForCamera();
    } + ')();';
    document.body.appendChild(zoomScript);

    // ================================================
    // BOT + MENU
    // ================================================
    let botOn       = false;
    let botInterval = null;
    let isDragging  = false;
    let dragOffX = 0, dragOffY = 0;
    let circleAngle = 0;
    let zigDir = 1, zigPos = 0;
    let randTimer = 0, randTargetX = 0, randTargetY = 0;
    let randCurrX = 0, randCurrY = 0;

    // ---- MENU HTML ----
    const menu = document.createElement('div');
    menu.id = 'bot-menu';
    menu.innerHTML = `
        <div id="bot-header">
            <span>🤖 BOT + ZOOM</span>
            <button id="bot-min-btn">—</button>
        </div>
        <div id="bot-body">

            <div class="bot-row" id="bot-row-main">
                <div class="bot-info">
                    <span class="bot-icon">🐍</span>
                    <span class="bot-label">Auto Movimiento</span>
                </div>
                <div class="bot-right">
                    <label class="bot-switch">
                        <input type="checkbox" id="chk-bot">
                        <span class="bot-slider"></span>
                    </label>
                    <span class="bot-status" id="bot-status-txt">OFF</span>
                </div>
            </div>

            <div class="sep"></div>

            <div class="section-title">Modo:</div>
            <div class="bot-modes">
                <label class="mode-opt"><input type="radio" name="botMode" value="circle" checked> 🔵 Círculo</label>
                <label class="mode-opt"><input type="radio" name="botMode" value="zigzag"> ↔ Zigzag</label>
                <label class="mode-opt"><input type="radio" name="botMode" value="random"> 🎲 Aleatorio</label>
            </div>

            <div class="sep"></div>

            <div class="speed-row">
                <span class="section-title" style="margin-bottom:0">Velocidad:</span>
                <input type="range" id="speed-slider" min="1" max="10" value="5" step="1">
                <span id="speed-val">5</span>
            </div>

            <div class="sep"></div>

            <div class="section-title">Zoom:</div>
            <div class="zoom-btns">
                <button class="zbtn" id="z-out">−</button>
                <span id="z-label">100%</span>
                <button class="zbtn" id="z-in">+</button>
                <button class="zbtn" id="z-reset">Reset</button>
            </div>
            <div class="zoom-hint">Rueda → zoom | R → reset</div>

            <div class="sep"></div>

            <div class="bot-hint">Numpad 1 → Bot &nbsp;|&nbsp; R → Reset zoom</div>
        </div>
    `;
    document.body.appendChild(menu);

    // ---- ESTILOS ----
    const style = document.createElement('style');
    style.innerHTML = `
        #bot-menu {
            position: fixed; top: 80px; right: 30px; width: 250px;
            background: #0d0d0d; border: 1.5px solid #00ff88; border-radius: 14px;
            z-index: 999999; box-shadow: 0 0 22px rgba(0,255,136,0.3);
            font-family: Arial, sans-serif; user-select: none; overflow: hidden;
        }
        #bot-header {
            display: flex; align-items: center; justify-content: space-between;
            background: #111; padding: 9px 13px; cursor: grab;
            border-bottom: 1px solid #1e1e1e;
            color: #00ff88; font-size: 12px; font-weight: bold; letter-spacing: 1.5px;
        }
        #bot-header:active { cursor: grabbing; }
        #bot-min-btn {
            background: none; border: 1px solid #333; color: #888; border-radius: 5px;
            width: 22px; height: 22px; cursor: pointer; font-size: 14px;
            display: flex; align-items: center; justify-content: center; padding: 0; transition: 0.15s;
        }
        #bot-min-btn:hover { border-color: #00ff88; color: #00ff88; }
        #bot-body {
            padding: 12px 14px;
            transition: max-height 0.25s ease, padding 0.25s, opacity 0.2s;
            max-height: 500px; opacity: 1; overflow: hidden;
        }
        #bot-body.hidden { max-height: 0; padding: 0 14px; opacity: 0; }

        .bot-row {
            display: flex; align-items: center; justify-content: space-between;
            background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
            padding: 9px 11px; transition: border-color 0.2s, box-shadow 0.2s;
        }
        .bot-row.active { border-color: #00ff88; box-shadow: 0 0 10px rgba(0,255,136,0.15); }
        .bot-info { display: flex; align-items: center; gap: 9px; }
        .bot-icon { font-size: 18px; }
        .bot-label { color: #aaa; font-size: 12px; }
        .bot-right { display: flex; align-items: center; gap: 7px; }

        .bot-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
        .bot-switch input { opacity: 0; width: 0; height: 0; }
        .bot-slider {
            position: absolute; cursor: pointer; top:0; left:0; right:0; bottom:0;
            background: #2e2e2e; border-radius: 22px; border: 1px solid #444; transition: 0.25s;
        }
        .bot-slider::before {
            content:""; position:absolute; height:16px; width:16px;
            left:3px; bottom:2px; background:#777; border-radius:50%; transition:0.25s;
        }
        .bot-switch input:checked + .bot-slider { background:#00cc6a; border-color:#00ff88; box-shadow:0 0 8px rgba(0,255,136,0.4); }
        .bot-switch input:checked + .bot-slider::before { transform:translateX(18px); background:#fff; }
        .bot-status { font-size:11px; font-weight:bold; color:#444; min-width:22px; transition:color 0.2s; }
        .bot-row.active .bot-status { color:#00ff88; }

        .sep { height:1px; background:#1e1e1e; margin:10px 0; }
        .section-title { font-size:11px; color:#666; margin-bottom:7px; }

        .bot-modes { display:flex; flex-direction:column; gap:5px; }
        .mode-opt { display:flex; align-items:center; gap:7px; font-size:12px; color:#aaa; cursor:pointer; }
        .mode-opt input[type=radio] { accent-color:#00ff88; cursor:pointer; }

        .speed-row { display:flex; align-items:center; gap:8px; }
        #speed-slider { flex:1; accent-color:#00ff88; }
        #speed-val { font-size:12px; font-weight:bold; color:#00ff88; min-width:14px; text-align:right; }

        .zoom-btns { display:flex; align-items:center; gap:6px; margin-bottom:5px; }
        .zbtn {
            background:#1a1a1a; border:1px solid #333; color:#00ff88;
            border-radius:6px; width:28px; height:28px; cursor:pointer;
            font-size:16px; display:flex; align-items:center; justify-content:center;
            transition:0.15s; padding:0;
        }
        .zbtn:hover { border-color:#00ff88; background:#111; }
        #z-reset { width:auto; padding:0 8px; font-size:11px; }
        #z-label { font-size:12px; font-weight:bold; color:#fff; min-width:38px; text-align:center; }
        .zoom-hint { font-size:10px; color:#444; margin-top:2px; }
        .bot-hint { font-size:10px; color:#333; text-align:center; }
    `;
    document.head.appendChild(style);

    // ---- DRAGGABLE ----
    const hdr = document.getElementById('bot-header');
    hdr.addEventListener('mousedown', e => {
        if (e.target.id === 'bot-min-btn') return;
        isDragging = true;
        const r = menu.getBoundingClientRect();
        dragOffX = e.clientX - r.left;
        dragOffY = e.clientY - r.top;
        e.preventDefault();
    });
    document.addEventListener('mousemove', e => {
        if (!isDragging) return;
        menu.style.left  = Math.max(0, Math.min(window.innerWidth  - menu.offsetWidth,  e.clientX - dragOffX)) + 'px';
        menu.style.top   = Math.max(0, Math.min(window.innerHeight - menu.offsetHeight, e.clientY - dragOffY)) + 'px';
        menu.style.right = 'auto';
    });
    document.addEventListener('mouseup', () => { isDragging = false; });

    // ---- MINIMIZAR ----
    let minimized = false;
    document.getElementById('bot-min-btn').addEventListener('click', () => {
        minimized = !minimized;
        document.getElementById('bot-body').classList.toggle('hidden', minimized);
        document.getElementById('bot-min-btn').textContent = minimized ? '+' : '—';
    });

    // ---- VELOCIDAD ----
    const speedSlider = document.getElementById('speed-slider');
    const speedValEl  = document.getElementById('speed-val');
    speedSlider.addEventListener('input', () => {
        speedValEl.textContent = speedSlider.value;
        if (botOn) { stopBot(); startBot(); }
    });

    function getMode() {
        return document.querySelector('input[name="botMode"]:checked')?.value || 'circle';
    }

    // ---- ENVIAR MOUSE ----
    function sendMouse(x, y) {
        const canvas = document.querySelector('canvas');
        if (!canvas) return;
        canvas.dispatchEvent(new MouseEvent('mousemove', { clientX: x, clientY: y, bubbles: true }));
    }

    // ---- MOVIMIENTOS ----
    function getAngleStep() {
        const v = parseInt(speedSlider.value);
        return 0.008 + (v - 1) * (0.06 - 0.008) / 9;
    }

    function tickCircle() {
        circleAngle += getAngleStep();
        if (circleAngle > Math.PI * 2) circleAngle -= Math.PI * 2;
        sendMouse(
            window.innerWidth  / 2 + Math.cos(circleAngle) * 180,
            window.innerHeight / 2 + Math.sin(circleAngle) * 180
        );
    }

    function tickZigzag() {
        const speed = 2 + parseInt(speedSlider.value) * 0.8;
        zigPos += speed * zigDir;
        if (zigPos > 220 || zigPos < -220) zigDir *= -1;
        sendMouse(
            window.innerWidth  / 2 + zigPos,
            window.innerHeight / 2 + Math.sin(zigPos * 0.03) * 100
        );
    }

    function tickRandom() {
        randTimer--;
        if (randTimer <= 0) {
            randTimer = 40 + Math.floor(Math.random() * 80);
            randTargetX = window.innerWidth  * 0.15 + Math.random() * window.innerWidth  * 0.7;
            randTargetY = window.innerHeight * 0.15 + Math.random() * window.innerHeight * 0.7;
            if (!randCurrX) { randCurrX = window.innerWidth / 2; randCurrY = window.innerHeight / 2; }
        }
        randCurrX += (randTargetX - randCurrX) * 0.08;
        randCurrY += (randTargetY - randCurrY) * 0.08;
        sendMouse(randCurrX, randCurrY);
    }

    function startBot() {
        const mode = getMode();
        botInterval = setInterval(() => {
            if      (mode === 'circle') tickCircle();
            else if (mode === 'zigzag') tickZigzag();
            else                        tickRandom();
        }, 16);
    }

    function stopBot() {
        if (botInterval) { clearInterval(botInterval); botInterval = null; }
    }

    // ---- TOGGLE BOT ----
    const chkBot    = document.getElementById('chk-bot');
    const rowMain   = document.getElementById('bot-row-main');
    const statusTxt = document.getElementById('bot-status-txt');

    function activateBot(state) {
        botOn = state;
        chkBot.checked = state;
        if (state) {
            circleAngle = 0; zigPos = 0; zigDir = 1; randTimer = 0;
            startBot();
            rowMain.classList.add('active');
            statusTxt.textContent = 'ON';
        } else {
            stopBot();
            rowMain.classList.remove('active');
            statusTxt.textContent = 'OFF';
        }
    }

    chkBot.addEventListener('change', () => activateBot(chkBot.checked));
    document.querySelectorAll('input[name="botMode"]').forEach(r => {
        r.addEventListener('change', () => { if (botOn) { stopBot(); startBot(); } });
    });

    // ---- BOTONES ZOOM (UI) ----
    // Comunicacion con el zoom inyectado via evento personalizado
    let uiZoomLevel = 100; // en porcentaje para mostrar

    function updateZoomLabel() {
        document.getElementById('z-label').textContent = uiZoomLevel + '%';
    }

    function dispatchZoomWheel(direction) {
        // Simula rueda para que el zoom script lo capture
        window.dispatchEvent(new WheelEvent('wheel', {
            deltaY: direction > 0 ? 120 : -120,
            bubbles: true, cancelable: true
        }));
        uiZoomLevel = Math.max(10, Math.min(500, uiZoomLevel + (direction > 0 ? -20 : 20)));
        updateZoomLabel();
    }

    document.getElementById('z-in').addEventListener('click',    () => dispatchZoomWheel(-1));
    document.getElementById('z-out').addEventListener('click',   () => dispatchZoomWheel(1));
    document.getElementById('z-reset').addEventListener('click', () => {
        // Simula tecla R para reset
        document.dispatchEvent(new KeyboardEvent('keydown', { key: 'r', bubbles: true }));
        uiZoomLevel = 100;
        updateZoomLabel();
    });

    // Actualizar label cuando el usuario usa la rueda
    window.addEventListener('wheel', (e) => {
        const step = e.shiftKey ? 100 : 20;
        uiZoomLevel = Math.max(10, Math.min(500, uiZoomLevel + (e.deltaY > 0 ? step : -step)));
        updateZoomLabel();
    }, { passive: true });

    // ---- HOTKEY Numpad 1 ----
    window.addEventListener('keydown', e => {
        if (e.code === 'Numpad1') {
            e.preventDefault();
            activateBot(!botOn);
        }
    }, true);

})();
ENDOFSCRIPT