useful hats

flipper hat, spike gear, samurai armour

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         useful hats
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  flipper hat, spike gear, samurai armour
// @author       alcachoo
// @match        http://moomoo.io/*
// @match        http://sandbox.moomoo.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

       var ID_FlipperHat = 31; // (f) to use
    var ID_SpikeGear = 11; // (caps lock) to use, i don't know if the 2 key works for it aswell.
    var ID_SamuraiArmour = 20; // (\) to use
    var ID_WinterHat = 15; // (v) to use

    document.addEventListener('keydown', function(e) {
        if(e.keyCode === 16 && document.activeElement.id.toLowerCase() !== 'chatbox')
        {
        storeEquip(0);
        }
        else if (e.keyCode === 70 && document.activeElement.id.toLowerCase() !== 'chatbox') // 70 is the keycode for (f)
        {
        storeEquip(ID_FlipperHat); // the hat in the game is named 31 in the storeEquip also called the hat shop. i made it so that ID_FlipperHat and 31 can be used though writing var ID_FlipperHat == 31. var just stands for Variable
        }
        else if (e.keyCode === 20 && document.activeElement.id.toLowerCase() !== 'chatbox')
        {
        storeEquip(ID_SpikeGear);
        }
        else if (e.keyCode === 220 && document.activeElement.id.toLowerCase() !== 'chatbox')
        {
        storeEquip(ID_SamuraiArmour);
        }
        else if (e.keycode === 86 && document.activeElement.id.toLowerCase() !== "chatbox")
        {
        storeEquip(ID_WinterHat);
        }
    });

})();