Greasy Fork

Greasy Fork is available in English.

MOOMOO.IO Toggle random hats!!! (BETA)

Looks SUPER COOL!!!!!

目前为 2020-06-07 提交的版本,查看 最新版本

// ==UserScript==
// @name         MOOMOO.IO Toggle random hats!!! (BETA)
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Looks SUPER COOL!!!!!
// @author       Cody Webb
// @match                 *://moomoo.io/*
// @match                 *://sandbox.moomoo.io/*
// @match                 *://dev.moomoo.io/*
// @grant        none
// ==/UserScript==

(function() {
    document.title = "MooHat Switcher"
    document.getElementById("gameName").innerHTML = "MooHat </br> Switcher";
    let toggleKey = 0
    const waitTime = 500
    const hatList = {
        0: 0,
        1: 51,
        2: 52,
        3: 29,
        4: 30,
        5: 36,
        6: 37,
        7: 38,
        8: 44,
        9: 35,
        10: 42,
        11: 43,
        12: 49
    };

    document.AddEventListener('Keydown', function(e){
        if (e.keycode === 84 && document.activeElement.id.toLowerCase() !== 'chatbox'){
            if (toggleKey === 0){
                toggleKey = 1;
            } else {
                toggleKey = 0;
                storeEquip(0);
            }
        }
    });

    const randomHat = () => {
        if (toggleKey = 1) {
            storeEquip(Math.floor(Math.random() * 13));
        }
    };

    window.setTimeout(randomHat, waitTime);
})();