Greasy Fork

Greasy Fork is available in English.

MOOMOO.IO Toggle rainbowhat!!! (BETA)

-------------Looks SUPER COOL!!!!!---------------

当前为 2020-06-08 提交的版本,查看 最新版本

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

(function(){
    document.title = "Rainbow MooMod";
    document.getElementById("gameName").innerHTML = "Rainbow </br> MooMod";
    var toggleKey = 1;
    var waitTime = 350;
    var 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
    };
    
    function checkT() {
            document.AddEventListener('Keypress', function(e){
                if (e.keycode === 84 && document.activeElement.id.toLowerCase() !== 'chatbox'){
                    if (toggleKey === 0){
                        toggleKey = 1;
                    } else if (toggleKey === 1){
                        toggleKey = 0;
                        storeEquip(0);
                    } else {
                        alert('An ERROR occurred with the toggle key:</br>    please report this issue to the greayfork forum. </br> -Thank you,  Cody Webb');
                    }
                }
            });
    }
    
    function randomHat() {
        if (toggleKey === 1) {
            storeEquip(hatList[Math.floor(Math.random() * 13)]);
        }
    }
    
    
    checkT();
    window.setTimeout(randomHat, waitTime);
})();