MooMoo Performance Menu

FPS Booster For PC low-end By Zama (Not Hack! :D)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         MooMoo Performance Menu
// @namespace    moomoo.optimizer
// @version      2.1
// @description  FPS Booster For PC low-end By Zama (Not Hack! :D)
// @author       Zama
// @match        *://moomoo.io/*
// @match        *://*.moomoo.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const STORAGE_KEY = "moomoo_performance_settings";

    let settings = JSON.parse(
        localStorage.getItem(STORAGE_KEY) ||
        '{"optimizer":true,"fps":true,"video":true,"ultra":false,"night":false}'
    );

    let styleTag = null;
    let nightOverlay = null;

    function saveSettings() {
        localStorage.setItem(STORAGE_KEY, JSON.stringify(settings));
    }

    function applyOptimizer() {

        if (styleTag) styleTag.remove();

        styleTag = document.createElement("style");

        let css = "";

        if (settings.optimizer) {
            css += `
                *,
                *::before,
                *::after{
                    animation:none!important;
                    transition:none!important;
                    box-shadow:none!important;
                    text-shadow:none!important;
                }
            `;
        }

        if (settings.fps) {
            css += `
                canvas{
                    image-rendering:pixelated!important;
                }
            `;
        }

        if (settings.ultra) {
            css += `
                *{
                    filter:none!important;
                    backdrop-filter:none!important;
                }
            `;
        }

        styleTag.textContent = css;
        document.head.appendChild(styleTag);

        if (settings.video) {
            document.querySelectorAll("video").forEach(v => {
                v.style.display = "none";
            });
        }

        if (settings.ultra) {
            document.querySelectorAll("iframe").forEach(i => {
                i.style.display = "none";
            });
        }

        // NIGHT MODE
        if (settings.night) {

            if (!nightOverlay) {

                nightOverlay = document.createElement("div");

                Object.assign(nightOverlay.style, {
                    position: "fixed",
                    inset: "0",
                    background: "rgba(0,0,0,0.25)",
                    pointerEvents: "none",
                    zIndex: "999998"
                });

                document.body.appendChild(nightOverlay);
            }

        } else {

            if (nightOverlay) {
                nightOverlay.remove();
                nightOverlay = null;
            }
        }

        console.log("Optimizer Updated", settings);
    }

    applyOptimizer();

    const menu = document.createElement("div");

    Object.assign(menu.style, {
        position: "fixed",
        top: "60px",
        right: "10px",
        width: "250px",
        background: "rgba(0,0,0,0.85)",
        color: "white",
        padding: "10px",
        borderRadius: "8px",
        zIndex: "999999",
        fontFamily: "Arial",
        display: "none"
    });

    document.body.appendChild(menu);

    function createToggle(label, key) {

        const row = document.createElement("div");
        row.style.marginBottom = "8px";

        const checkbox = document.createElement("input");
        checkbox.type = "checkbox";
        checkbox.checked = settings[key];

        checkbox.addEventListener("change", () => {
            settings[key] = checkbox.checked;
            saveSettings();
            applyOptimizer();
        });

        row.appendChild(checkbox);

        const text = document.createElement("span");
        text.textContent = " " + label;

        row.appendChild(text);

        return row;
    }

    const title = document.createElement("h3");
    title.textContent = "Performance Menu By Zama";
    title.style.marginTop = "0";

    menu.appendChild(title);

    menu.appendChild(createToggle("Optimizer", "optimizer"));
    menu.appendChild(createToggle("FPS Stabilizer", "fps"));
    menu.appendChild(createToggle("Hide Videos", "video"));
    menu.appendChild(createToggle("Ultra Low Mode", "ultra"));
    menu.appendChild(createToggle("Night Mode", "night"));

    const info = document.createElement("div");
    info.style.marginTop = "10px";
    info.innerHTML = "Press ESC For Open/Close Menu";
    menu.appendChild(info);

    document.addEventListener("keydown", (e) => {

        if (e.key === "Escape") {

            menu.style.display =
                menu.style.display === "none"
                    ? "block"
                    : "none";
        }
    });

    const fpsBox = document.createElement("div");

    Object.assign(fpsBox.style, {
        position: "fixed",
        top: "10px",
        right: "10px",
        background: "rgba(0,0,0,0.8)",
        color: "lime",
        padding: "5px 10px",
        borderRadius: "6px",
        zIndex: "999999",
        fontFamily: "monospace"
    });

    document.body.appendChild(fpsBox);

    let last = performance.now();
    let frames = 0;

    function fpsLoop(now) {

        frames++;

        if (now - last >= 1000) {
            fpsBox.textContent = `FPS: ${frames}`;
            frames = 0;
            last = now;
        }

        requestAnimationFrame(fpsLoop);
    }

    requestAnimationFrame(fpsLoop);

})();