🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Moomoo.io New cyan color

Adds a new cyan color to the color selection panel

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name Moomoo.io New cyan color
// @author Murka
// @description Adds a new cyan color to the color selection panel
// @icon https://moomoo.io/img/favicon.png?v=1
// @version 0.3
// @match *://moomoo.io/*
// @match *://*.moomoo.io/*
// @run-at document-start
// @grant none
// @license MIT
// @namespace https://greasyfork.org/users/919633
// ==/UserScript==
/* jshint esversion:6 */

/*
    Author: Murka
    Github: https://github.com/Murka007
    Discord: https://discord.gg/cPRFdcZkeD
    Greasyfork: https://greasyfork.org/en/users/919633
    MooMooForge: https://github.com/MooMooForge
*/

(function() {
    "use strict";

    const log = console.log;
    const storage = {
        get(key) {
            const value = localStorage.getItem(key);
            return value === null ? null : value;
        },
        set(key, value) {
            localStorage.setItem(key, typeof value !== "string" ? JSON.stringify(value) : value);
        }
    };

    // Unlock 100 resource bonus
    storage.set("moofoll", 1);

    function createHook(target, prop, setter) {
        const symbol = Symbol(prop);
        Object.defineProperty(target, prop, {
            get() {
                return this[symbol];
            },
            set(value) {
                setter(this, symbol, value);
            },
            configurable: true
        })
    }

    // Add cyan color to the skinColor array
    createHook(Object.prototype, "skinColors", function(that, symbol, value) {
        delete Object.prototype.skinColors;
        that.skinColors = [...value, "#91B2DB"];
    })

    // When choosing a color, replace index with "toString", so server will cause some error that will make your color cyan
    createHook(window, "selectSkinColor", function(that, symbol, value) {
        delete window.selectSkinColor;
        window.selectSkinColor = new Proxy(value, {
            apply(target, _this, args) {
                const [ skin ] = args;
                target.call(_this, skin === 10 ? "toString" : skin);

                storage.set("skinColor", skin);
                if (skin === 10) {
                    const skins = document.querySelectorAll("#skinColorHolder > *");
                    const last = skins[skins.length-1];
                    last.classList.add("activeSkin");
                }
            }
        })
    })

    // Select saved color on the load
    window.addEventListener("load", function() {
        const observer = new MutationObserver(mutations => {
            observer.disconnect();
            for (const mutation of mutations) {
                const index = storage.get("skinColor") || 0;
                mutation.addedNodes[index].click();
            }
        })
        observer.observe(document.querySelector("#skinColorHolder"), { childList: true, subtree: true });
    })

})();