Hack Mod [ MooMoo Version ]

R = Insta | Click Right = Break | Click Left = Atack | Shift Left / Right = Speed | AutoHeal | AutoGG | T = Defense | FlipperMode = P || Unequip = - || OP Hack!!

// ==UserScript==
// @name         Hack Mod [ MooMoo Version ]
// @namespace    http://tampermonkey.net/
// @version      v2.3
// @description  R = Insta | Click Right = Break | Click Left = Atack | Shift Left / Right = Speed | AutoHeal | AutoGG | T = Defense | FlipperMode = P || Unequip = - || OP Hack!!
// @author       2k09__
// @match        https://moomoo.io/
// @match        https://dev.moomoo.io/
// @match        https://sandbox.moomoo.io/
// @license      MIT
// @grant        none
// ==/UserScript==
document.title = "Hack Mod"
document.getElementById("gameName").innerHTML = "Hack Mod";
document.getElementById("gameName").style.color = "#000000";
document.getElementById("leaderboard").innerHTML = "Q";
document.getElementById("leaderboard").style.color = "blue";
document.getElementById("deadText").innerHTML = "You Are Noob ?";
document.getElementById("deadText").style.color = "blue";
document.getElementById("loadingText").innerHTML = "Hack Mod Reload...";
document.getElementById("loadingText").style.color = "#000000";
$("#moomooio_728x90_home").parent().css({display: "none"});

var accesoryList = {
    Unequip: 0,
    Snowball: 12,
    TreeCape: 9,
    StoneCape: 10,
    CookieCape: 3,
    CowCape: 8,
    MonkeyTail: 11,
    AppleBasket: 17,
    WinterCape: 6,
    SkullCape: 4,
    DashCape: 5,
    DragonCape: 2,
    SuperCape: 1,
    TrollCape: 7,
    Thorns: 14,
    Blockades: 15,
    DevilsTail: 20,
    Sawblade: 16,
    AngelWings: 13,
    ShadowWings: 19,
    BloodWings: 18,
    CorruptXWings: 21
};

var hatList = {
    Unequip: 0,
    MooCap: 51,
    AppleCap: 50,
    MooHead: 28,
    PigHead: 29,
    FluffHead: 30,
    PandouHead: 36,
    BearHead: 37,
    MonkeyHead: 38,
    PolarHead: 44,
    FezHat: 35,
    EnigmaHat: 42,
    BlitzHat: 43,
    BobXIIIHat: 49,
    Pumpkin: 57,
    BummleHat: 8,
    StrawHat: 2,
    WinterCap: 15,
    CowboyHat: 5,
    RangerHat: 4,
    ExplorerHat: 18,
    FlipperHat: 31,
    MarksmanCap: 1,
    BushGear: 10,
    Halo: 48,
    SoldierHelmet: 6,
    AntiVenomGear: 23,
    MedicGear: 13,
    MinersHelmet: 9,
    MusketeerHat: 32,
    BullHelmet: 7,
    EmpHelmet: 22,
    BoosterHat: 12,
    BarbarianArmor: 26,
    PlagueMask: 21,
    BullMask: 46,
    WindmillHat: 14,
    SpikeGear: 11,
    TurretGear: 53,
    SamuraiArmor: 20,
    DarkKnight: 58,
    ScavengerGear: 27,
    TankGear: 40,
    ThiefGear: 52,
    Bloodthirster: 55,
    AssassinGear: 56
   };

    function buyAndEquipHat(name) {
        var target = hatList.name;
        storeBuy(target);
        storeEquip(target);
    };
    function buyAndEquipAccesory(name) {
        var target2 = accesoryList.name;
        storeBuy(target2);
        storeEquip(target2);
    };
      let {
         secondary: o
      } = Insta.myPlayer.inventory,
         t = Insta.ActivePlayerManager.getClosestEnemyAngle(), {
            primary: a,
         } = Insta.myPlayer.inventory;
function Insta() {
    setTimeout(() => {
    Insta.myPlayer.hit(t);
    Insta.myPlayer.buyAndEquipHat(26);
    Insta.myPlayer.buyAndEquipAccesory(19);
    Insta.sendPacket("5", a, true);
    }, 500);
    setTimeout(() => {
    Insta.myPlayer.hit(t);
    Insta.myPlayer.buyAndEquipHat(7);
    Insta.myPlayer.buyAndEquipAccesory(18);
    Insta.sendPacket("5", o, true);
    }, 1500);
    setTimeout(() => {
    Insta.myPlayer.hit(t);
    Insta.sendPacket("5", a, true);
    Insta.myPlayer.buyAndEquipHat(53);
    Insta.myPlayer.buyAndEquipAccesory(11);
    }, 1500);
    setTimeout(() => {
    Insta.sendPacket("5", o, true);
    Insta.myPlayer.buyAndEquipHat(20);
    Insta.myPlayer.buyAndEquipAccesory(13);
    }, 1000);
    setTimeout(() => {
    Insta.sendPacket("5", a, true);
    Insta.myPlayer.buyAndEquipHat(6);
    Insta.myPlayer.buyAndEquipAccesory(11);
    }, 500);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "r" || event.keyCode === "R") {
            Insta
        };
    });
};
let {
    secondary: hammer
} = Break.myPlayer.inventory;
function Break() {
    setTimeout(() => {
        Break.sendPacket("5", a, hammer, true);
        Break.myPlayer.buyAndEquipHat(40);
        Break.myPlayer.buyAndEquipAccesory(21);
    }, 500);
    setTimeout(() => {
        Break.sendPacket("5", a, hammer, true);
        Break.myPlayer.buyAndEquipHat(50);
        Break.myPlayer.buyAndEquipAccesory(11);
    }, 1000);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "RightClick") {
            Break
        };
    });
};
function Atack() {
    setTimeout(() => {
        Atack.sendPacket("5", a, true);
        Atack.myPlayer.buyAndEquipHat(12);
        Atack.myPlayer.buyAndEquipAccesory(11);
    }, 1000);
    setTimeout(() => {
        Atack.sendPacket("5", a, true);
        Atack.myPlayer.buyAndEquipHat(7);
        Atack.myPlayer.buyAndEquipAccesory(18);
    }, 1000);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "LeftClick") {
            Atack
        };
    });
};
function Speed() {
    setTimeout(() => {
    Speed.myPlayer.buyAndEquipHat(12);
    Speed.myPlayer.buyAndEquipAccesory(11);
    }, 1500);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "ShiftLeft" || event.keyCode === "ShiftRight") {
            Speed
        };
    });
};
function Defense() {
    setTimeout(() => {
        Defense.myPlayer.buyAndEquipHat(6);
        Defense.myPlayer.buyAndEquipAccesory(21);
    }, 1000);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "t" || event.keyCode === "T") {
            Defense
        };
    });
};
function FlipperMode() {
    setTimeout(() => {
        FlipperMode.myPlayer.buyAndEquipHat(31);
        FlipperMode.myPlayer.buyAndEquipAccesory(11);
    }, 500);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "p" || event.keyCode === "P") {
            FlipperMode
        };
    });
};
let AutoHeal = true;

    AutoHeal.addEventListener("updatehealth", (data) => {
    let sid = data[0]
    let health = data[1]

    if (AutoHeal.myPlayer.sid === sid && health < 100) {

        let food = AutoHeal.myPlayer.inventory.food;

        if(health < 100 && health > 79) {
        setTimeout(() => {
        AutoHeal.myPlayer.place(food)
        }, 90);
        } else if(health < 80 && health > 59) {
            buyAndEquipHat(6);
            buyAndEquipAccesory(21);
            setTimeout(() => {
                AutoHeal.myPlayer.place(food)
                AutoHeal.myPlayer.place(food)
            }, 90);
        } else if(health < 60 && health > 39) {
            buyAndEquipHat(7);
            buyAndEquipAccesory(13);
            AutoHeal.myPlayer.place(food)
            AutoHeal.myPlayer.place(food)
        } else if(health < 40 && health > 0) {
            buyAndEquipHat(7)
            buyAndEquipAccesory(13);
            AutoHeal.myPlayer.place(food)
            AutoHeal.myPlayer.place(food)
            AutoHeal.myPlayer.place(food)
        };
    };
});
function Unequip() {
    setTimeout(() => {
    Unequip.myPlayer.buyAndEquipHat(0);
    Unequip.myPlayer.buyAndEquipAccesory(0);
    }, 1000);
    document.addEventListener('keydown', function(event) {
        if (event.keyCode === "Slash") {
            Unequip
        };
    });
};
let ws;
let msgpack5 = window.msgpack;
 let prevCount = 0;
const attachWebSocketListener = e => {
  e.addEventListener("message", hookWS);
};
const hookWS = e => {
  // You can add actions related to WebSocket messages here
};
const sendPacket = e => {
  if (ws) {
    ws.send(msgpack5.encode(e));
  }
};
const chat = e => {
  sendPacket(["6", [e]]);
};
WebSocket.prototype.oldSend = WebSocket.prototype.send;
WebSocket.prototype.send = function (e) {
  if (!ws) {
    [document.ws, ws] = [this, this];
    attachWebSocketListener(this);
  }
  this.oldSend(e);
};
const handleMutations = mutationsList => {
  for (const mutation of mutationsList) {
    if (mutation.target.id === "killCounter") {
      const count = parseInt(mutation.target.innerText, 10) || 0;
      if (count > prevCount) {
        chat("gg - AutoGG Master Race");
        prevCount = count;
      }
    }
  }
};
const observer = new MutationObserver(handleMutations);
observer.observe(document, {
  subtree: true,
  childList: true
});