Greasy Fork is available in English.

MooMoo.io (Script Brasileiro [Brazillian Script])

Auto come quando HP <65% (pizza/cookie/food em slots 7/8/9). V=spike (slot6), F=trap(slot7), H=turret(slot8). Zoom wheel.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         MooMoo.io (Script Brasileiro [Brazillian Script])
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Auto come quando HP <65% (pizza/cookie/food em slots 7/8/9). V=spike (slot6), F=trap(slot7), H=turret(slot8). Zoom wheel.
// @author       Grok
// @match        *://moomoo.io/*
// @match        *://*.moomoo.io/*
// @grant        none
// @require      https://greasyfork.org/scripts/423602-msgpack/code/msgpack.js
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    let ws = null;
    let aimAngle = 0;
    let lastHp = 100;
    let eatCooldown = 0;
    let placeCooldown = 0;
    let canvas = null;
    let zoomLevel = 1;
    const MIN_ZOOM = 0.4;
    const MAX_ZOOM = 2.8;

    // Captura WebSocket
    const OldWebSocket = window.WebSocket;
    window.WebSocket = function(...args) {
        const inst = new OldWebSocket(...args);
        ws = inst;
        return inst;
    };
    window.WebSocket.prototype = OldWebSocket.prototype;

    function sendPacket(type, ...data) {
        if (!ws || ws.readyState !== WebSocket.OPEN) return false;
        try {
            const packet = msgpack.encode([type, ...data]);
            ws.send(packet);
            return true;
        } catch (e) {
            return false;
        }
    }

    function getCurrentSlot() {
        const items = document.getElementById('items');
        if (!items) return 0;
        const slots = items.querySelectorAll('div');
        for (let i = 0; i < slots.length; i++) {
            if (slots[i].classList.contains('selected')) return i;
        }
        return 0;
    }

    function eatSlot(slot) {
        const weaponSlot = getCurrentSlot();
        sendPacket('z', slot, false);
        setTimeout(() => sendPacket('F', 1), 10);
        setTimeout(() => sendPacket('F', 0), 30);
        if (weaponSlot !== slot) {
            setTimeout(() => sendPacket('z', weaponSlot, true), 50);
        }
    }

    function doAutoHeal() {
        if (eatCooldown > 0) return;
        // Tenta pizza(9), cookie(8), food(7) - Coloque neles!
        for (let slot of [9, 8, 7]) {
            eatSlot(slot);
            break; // Só tenta um por vez
        }
        eatCooldown = 12; // ~360ms cooldown
    }

    function place(slot) {
        if (placeCooldown > 0) return;
        const angle = aimAngle;
        const weaponSlot = getCurrentSlot();
        sendPacket('z', slot, true);
        setTimeout(() => {
            sendPacket('F', 1, angle);
        }, 20);
        setTimeout(() => {
            sendPacket('F', 0, angle);
            if (weaponSlot !== slot) {
                sendPacket('z', weaponSlot, true);
            }
        }, 70);
        placeCooldown = 4; // ~120ms anti-spam
    }

    function updateAim(e) {
        if (!canvas) return;
        const rect = canvas.getBoundingClientRect();
        const x = e.clientX - rect.left;
        const y = e.clientY - rect.top;
        const cx = canvas.width * 0.5;
        const cy = canvas.height * 0.5;
        aimAngle = Math.atan2(y - cy, x - cx);
    }

    function updateZoom() {
        if (canvas) {
            canvas.style.transform = `scale(${zoomLevel})`;
            canvas.style.transformOrigin = 'center center';
        }
    }

    // Loop principal
    setInterval(() => {
        // Pega canvas
        canvas = document.querySelector('canvas');
        if (canvas && !canvas.dataset.hooked) {
            canvas.dataset.hooked = '1';
            canvas.addEventListener('mousemove', updateAim);
            canvas.addEventListener('wheel', (e) => {
                e.preventDefault();
                zoomLevel += e.deltaY > 0 ? -0.08 : 0.08;
                zoomLevel = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, zoomLevel));
                updateZoom();
            }, { passive: false });
        }

        // Auto-heal poll
        try {
            const hpBar = document.querySelector('#healthBarInner');
            if (hpBar) {
                const currHp = parseFloat(hpBar.style.width || '100');
                if (currHp < lastHp && currHp < 65) {
                    doAutoHeal();
                }
                lastHp = currHp;
            }
        } catch (e) {}

        if (eatCooldown > 0) eatCooldown--;
        if (placeCooldown > 0) placeCooldown--;

    }, 30);

    // Keybinds
    document.addEventListener('keydown', (e) => {
        if (e.repeat || !canvas) return;
        switch (e.key.toLowerCase()) {
            case 'v': place(6); break; // Spike slot 6
            case 'f': place(7); break; // Trap slot 7
            case 'h': place(8); break; // Turret slot 8 (ou tele se for 9, ajuste)
        }
    });

    console.log('%c🚀 MooMoo Auto-Heal + Hotkeys CARREGADO! (2026)', 'color:#0f0;font-size:16px;');
    console.log('%c• Auto-eat slots 9(pizza)/8(cookie)/7(food) quando HP<65%', 'color:#ff0');
    console.log('%c• V=Spike (slot6), F=Trap(slot7), H=Turret(tele slot8)', 'color:#ff0');
    console.log('%c• Ajuste slots no código se necessário. Zoom wheel OK!', 'color:#ff0');
    console.log('%cRisco ban médio. Teste em sandbox.moomoo.io primeiro! 🔥', 'color:#f0f');

})();