Hat Switch Injection

..

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Hat Switch Injection
// @version      0.2
// @description  ..
// @author       Creator
// @match        *://*.moomoo.io/*
// @grant        none
// @namespace https://greasyfork.org/users/206011
// ==/UserScript==

(function() {
    'use strict';
    var _hats = {
        "96": 3,  // Numpad 0; Hat 0/Nothing
        "97": 7,   // Numpad 1; Hat 7/Bull
        "98": 6,   // Numpad 2; Hat 6/Soldier
        "99": 20,  // Numpad 3; Hat 20/Samurai
        "100": 31, // Numpad 4; Hat 31/Fish
        "101": 10, // Numpad 5; Hat 10/Bush
        "102": 11, // Numpad 6; Hat 11/Spike
        "103": 22, // Numpad 7; Hat 22/Emp
        "104": 12, // Numpad 8; Hat 12/Speed
        "105": 40   // Numpad 9; Hat 40/Tank
    };
    var hats = Object.keys(_hats);

    document.onkeydown = function (e) {
        if (typeof storeEquip === "function") {
            var len = hats.length;
            var k = e.keyCode;
            if (_hats[k]) {
                storeBuy(_hats[k]); 
                storeEquip(_hats[k]); 
            }
        }
    }
})();