Sigmally Mod

Mod for Sigmally.com | by cursd#0126. Dark Mode, Long Nickname, Macros, Extanded Settings, Freeze Player, map customazation; Mod Menu

目前為 2023-05-08 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Sigmally Mod
// @version      2.5.6
// @description  Mod for Sigmally.com | by cursd#0126. Dark Mode, Long Nickname, Macros, Extanded Settings, Freeze Player, map customazation; Mod Menu
// @author       Cursed
// @match        *://sigmally.com/*
// @icon         https://raw.githubusercontent.com/Sigmally/SigMod/main/images/SigmodV2-Circle.png
// @run-at       document-end
// @license      MIT
// @namespace    https://greasyfork.org/users/981958
// ==/UserScript==

(function () {
    let rxSettings = localStorage.getItem("rxSettings");
    if (!rxSettings) {
        rxSettings = {
            keyBindingsRapidFeed: "q",
            keyBindingsdoubleSplit: "d",
            keyBindingsTripleSplit: "f",
            keyBindingsQuadSplit: "g",
            keyBindingsFreezePlayer: "s",
            mapColor: null,
            mapImageURL: "",
            darkMode: true,
        };
        localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
    } else {
        rxSettings = JSON.parse(rxSettings);
    }

    const rzModSettings = document.createElement("form");
    const ModSettingsOpen = document.createElement("button");
    ModSettingsOpen.addEventListener("click", () => rzModSettings.classList.toggle("hidden"));
    ModSettingsOpen.setAttribute("id", "SettingsButton");
    document.body.append(ModSettingsOpen);

    function k_p(key, keycode) {
        const keyDownEvent = new KeyboardEvent("keydown", { key: key, code: keycode });
        const keyUpEvent = new KeyboardEvent("keyup", { key: key, code: keycode });

        window.dispatchEvent(keyDownEvent);
        window.dispatchEvent(keyUpEvent);
    }
    function move(cx, cy) {
        const mouseMoveEvent = new MouseEvent("mousemove", { clientX: cx, clientY: cy });
        const canvas = document.querySelector("canvas");
        canvas.dispatchEvent(mouseMoveEvent);
    }
    function center(sx, sy) {
        const mouseMoveEvent = new MouseEvent("mousemove", { clientX: sx, clientY: sy });
        const canvas = document.getElementById("canvas");
        canvas.dispatchEvent(mouseMoveEvent);
    }

    rzModSettings.setAttribute("id", "rx-mod-settings");
    rzModSettings.classList.add("hidden");
    rzModSettings.onsubmit = (e) => {
        rzModSettings.classList.toggle("hidden");
        e.preventDefault();
        const mapColor = document.getElementById("mapColor");
        rxSettings.mapColor = mapColor.value;

        let options = new FormData(rzModSettings);

        for (var key of options.keys()) {
            rxSettings[key] = options.get(key);
        }

        localStorage.setItem("rxSettings", JSON.stringify(rxSettings));

        return false;
    };
    rzModSettings.innerHTML =
        '<div class="cztop">' +
        '<div class="cztopleft">' +
        '<img src="https://i.ibb.co/stQVx38/SigmodV2.png" draggable="false" class="titleImg">' +
        '<h4 class="SettingsTitle">Settings</h4>' +
        "</div>" +
        '<input type="submit" class="CloseBtn"; value="X"/>' +
        "</div>" +
        "<hr/>" +
        '<h5 class="Sett">Keybindings</h5>' +
        '<label class="flex">' +
        '<input type="text" name="keyBindingsRapidFeed" id="modinput1" class="keybinding" value="' +
        rxSettings.keyBindingsRapidFeed +
        '" maxlength="1" onfocus="this.select()">' +
        '<span class="Sett">Rapid Feed</span>' +
        "</label>" +
        '<label class="flex">' +
        '<input type="text" name="keyBindingsdoubleSplit" id="modinput2" class="keybinding" value="' +
        rxSettings.keyBindingsdoubleSplit +
        '" maxlength="1" onfocus="this.select()">' +
        '<span class="Sett">Double Split</span>' +
        "</label>" +
        '<label class="flex">' +
        '<input type="text" name="keyBindingsTripleSplit" id="modinput3" class="keybinding" value="' +
        rxSettings.keyBindingsTripleSplit +
        '" maxlength="1" onfocus="this.select()">' +
        '<span class="Sett">Triple Split</span>' +
        "</label>" +
        '<label class="flex">' +
        '<input type="text" name="keyBindingsQuadSplit" id="modinput4" class="keybinding" value="' +
        rxSettings.keyBindingsQuadSplit +
        '" maxlength="1" onfocus="this.select()">' +
        '<span class="Sett">Quad Split</span>' +
        "</label>" +
        "</label>" +
        '<label class="flex">' +
        '<input type="text" name="keyBindingsFreezePlayer" id="modinput5" class="keybinding" value="' +
        rxSettings.keyBindingsFreezePlayer +
        '" maxlength="1" onfocus="this.select()">' +
        '<span class="Sett">Freeze Player</span>' +
        "</label>" +
        "<hr />" +
        "<h5 class='Sett'>Map customization</h5>" +
        '<div id="mapcolorDiv">' +
        '<label class="flex" style="align-items: center;">' +
        '<span class="Sett">Map Color:</span>' +
        '<input type="color" value="' +
        rxSettings.mapColor +
        '" id="mapColor" class="colorInput">' +
        "</label>" +
        "</div>" +
        '<label class="flex" style="align-items: center; justify-content: space-around">' +
        '<span class="Sett">Map image: </span>' +
        '<input type="text" placeholder="background Image URL" id="mapImage" class="modInput" value="' +
        rxSettings.mapImageURL +
        '">' +
        "</label>" +
        '<div id="mapimageDiv" class="flex"></div>' +
        "<hr/>" +
        '<h4 class="Sett">Discord</h4>' +
        '<div class="modContainer"><a href="https://discord.gg/gHmhpCaPfP" target="_blank" class="modButton" style="width: 100%;">Join Sigmally Modz Server</a></div>' +
        "<hr/>" +
        '<h4 class="Sett">Stylish Names</h4>' +
        '<div class="modContainer"><a href="https://www.stylishnamemaker.com" target="_blank" class="modButton">Stylish Name Maker</a><a href="https://nickfinder.com" target="_blank" class="modButton">Nickfinder</a></div>' +
        "<hr/>" +
        '<h4 class="Sett">Youtube</h4>' +
        '<div class="modContainer"><a href="https://www.youtube.com/@cursed9645/" target="_blank" class="modButton">Cursed</a><a href="https://www.youtube.com/channel/UCEn7a9rEtJNsw1WKgsAoyXQ" class="modButton" target="_blank">Sigmally Modz</a></div>';
    const KEY_SPLIT = {
        keyCode: 32,
        code: "Space",
        cancelable: true,
        composed: true,
        isTrusted: true,
        which: 32,
    };
    const rzMods = [{
            modName: "Branding",
            modType: "automatic",
            modDescription: "Branding",
            modCode: () => {
                const gameTitle = document.getElementById("title");
                gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">Mod by Cursed / Ringzer0</span>';
            },
        }, {
            modName: "Game Settings",
            modType: "automatic",
            modDescription: "Extanded Game Settings",
            modCode: () => {
                const gameSettings = document.querySelector(".checkbox-grid");
                gameSettings.innerHTML += `
                <li>
                  <div class="pretty p-svg p-round p-smooth">
                    <input type="checkbox" id="showNames">
                    <div class="state p-success">
                      <svg class="svg svg-icon" viewBox="0 0 20 20">
                        <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
                      </svg>
                      <label>Names</label>
                    </div>
                  </div>
                </li>
                    <li>
                  <div class="pretty p-svg p-round p-smooth">
                    <input type="checkbox" id="showSkins">
                    <div class="state p-success">
                      <svg class="svg svg-icon" viewBox="0 0 20 20">
                        <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
                      </svg>
                      <label>Skins</label>
                    </div>
                  </div>
                </li>
                  <li>
                     <div class="pretty p-svg p-round p-smooth">
                        <input type="checkbox" id="longNick" checked>
                        <div class="state p-success">
                           <svg class="svg svg-icon" viewBox="0 0 20 20">
                              <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
                           </svg>
                           <label>Long Nick</label>
                        </div>
                     </div>
                  </li>
                  <li>
                     <div class="pretty p-svg p-round p-smooth">
                        <input type="checkbox" id="darkMenu">
                        <div class="state p-success">
                           <svg class="svg svg-icon" viewBox="0 0 20 20">
                              <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
                           </svg>
                           <label>Dark Menu</label>
                        </div>
                     </div>
                  </li>`;
            },
        }, {
            modName: "Macro",
            modType: "automatic",
            modDescription: "You feed faster",
            modCode: () => {
                let ff = null;
                let keydown = false;

                window.addEventListener("keyup", (e) => {
                    if (e.key == rxSettings.keyBindingsRapidFeed && keydown) {
                        clearInterval(ff);
                        keydown = false;
                    }
                });
                window.addEventListener("keydown", (e) => {
                    let x = true;
                    if (!x || document.activeElement.nodeName === "INPUT") {
                        return;
                    }
                    if (e.key == "Tab") {
                        e.preventDefault();
                    }

                    if (e.key == rxSettings.keyBindingsFreezePlayer) {
                        const CX = window.innerWidth / 2;
                        const CY = window.innerHeight / 2;

                        center(CX, CY);
                    }
                    if (e.key == rxSettings.keyBindingsRapidFeed && !keydown) {
                        keydown = true;
                        function fastMass() {
                            let x = 15;
                            while (x--) {
                                k_p("w", "KeyW");
                            }
                        }
                        ff = setInterval(fastMass, 50);
                    }
                    if (e.key == rxSettings.keyBindingsdoubleSplit) {
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        return;
                    }

                    if (e.key == rxSettings.keyBindingsTripleSplit) {
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        return;
                    }

                    if (e.key == rxSettings.keyBindingsQuadSplit) {
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keydown", KEY_SPLIT));
                        window.dispatchEvent(new KeyboardEvent("keyup", KEY_SPLIT));
                        return;
                    }
                });
            },
        }, {
            modName: "Long Nicknames",
            modType: "automatic",
            modDescription: "Allows for longer nicknames.",
            modCode: () => {
                const nickName = document.getElementById("nick");
                let longNick = document.getElementById("longNick");
                nickName.maxLength = 50;

                longNick.addEventListener("change", () => {
                    if (nickName.maxLength == 50) {
                        nickName.maxLength = 15;
                    } else if (nickName.maxLength == 15) {
                        nickName.maxLength = 50;
                    }
                });
            },
        }, {
            modName: "Dark Menu",
            modType: "automatic",
            modDescription: "Changes the menu colors to darker color.",
            modCode: () => {
                setTimeout(() => {
                    const menu = document.getElementById("menu");
                    const rightMenu = document.querySelector(".top-users__inner");
                    const leftMenu = document.getElementById("left-menu");
                    const linksMenu = document.querySelector(".menu-links");
                    const deathScreen = document.querySelector(".menu--stats-mode");
                    const skin_text = document.getElementById("js-skin-select-icon-text");
                    const nick = document.getElementById("nick");
                    const gamemode = document.getElementById("gamemode");
                    const gamemodeoptions = ["option_0", "option_1", "option_2"];
                    const signInBtn = document.getElementById("signInBtn");
                    let darkM = true;
                    let darkMode_cb = document.getElementById("darkMenu");
                    let b_inner = document.querySelector(".body__inner");
                    let elements = b_inner.querySelectorAll(".body__inner > :not(.body__inner), #s-skin-select-icon-text");
                    const darkColor = "#252525";
                    const darkColor2 = "#222222";
                    const lightColor = "#FFFFFF";
                    function darkMode() {
                        if (!darkM) {
                            darkM = true;
                            rxSettings.darkMode = true;
                            localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
                            skin_text.style.color = lightColor;

                            menu.style.backgroundColor = darkColor;
                            rightMenu.style.backgroundColor = darkColor;
                            leftMenu.style.backgroundColor = darkColor;
                            linksMenu.style.backgroundColor = darkColor;
                            deathScreen.style.backgroundColor = darkColor;
                            signInBtn.style.backgroundColor = darkColor;
                            signInBtn.style.color = lightColor;
                            nick.style.backgroundColor = darkColor;
                            nick.style.color = lightColor;
                            gamemode.style.backgroundColor = darkColor;
                            gamemode.style.color = lightColor;

                            gamemodeoptions.forEach((options) => {
                                const option = document.getElementById(options);
                                option.style.backgroundColor = darkColor;
                                option.style.color = lightColor;
                            });

                            elements.forEach((textElements) => {
                                textElements.style.color = lightColor;
                            });
                        } else {
                            darkM = false;
                            rxSettings.darkMode = false;
                            localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
                            skin_text.style.color = darkColor2;
                            menu.style.backgroundColor = lightColor;
                            rightMenu.style.backgroundColor = lightColor;
                            leftMenu.style.backgroundColor = lightColor;
                            linksMenu.style.backgroundColor = lightColor;
                            deathScreen.style.backgroundColor = lightColor;
                            signInBtn.style.backgroundColor = lightColor;
                            signInBtn.style.color = darkColor;
                            nick.style.backgroundColor = lightColor;
                            nick.style.color = darkColor;
                            gamemode.style.backgroundColor = lightColor;
                            gamemode.style.color = darkColor;

                            gamemodeoptions.forEach((options) => {
                                const option = document.getElementById(options);
                                option.style.backgroundColor = lightColor;
                                option.style.color = darkColor;
                            });

                            elements.forEach((textElements) => {
                                textElements.style.color = darkColor2;
                            });
                        }
                    }
                    darkMode_cb.addEventListener("change", darkMode);
                    if (rxSettings.darkMode) {
                        darkMode_cb.checked = true;
                        darkM = true;
                        skin_text.style.color = lightColor;
                        menu.style.backgroundColor = darkColor;
                        rightMenu.style.backgroundColor = darkColor;
                        leftMenu.style.backgroundColor = darkColor;
                        linksMenu.style.backgroundColor = darkColor;
                        deathScreen.style.backgroundColor = darkColor;
                        signInBtn.style.backgroundColor = darkColor;
                        signInBtn.style.color = lightColor;
                        nick.style.backgroundColor = darkColor;
                        nick.style.color = lightColor;
                        gamemode.style.backgroundColor = darkColor;
                        gamemode.style.color = lightColor;

                        gamemodeoptions.forEach((options) => {
                            const option = document.getElementById(options);
                            option.style.backgroundColor = darkColor;
                            option.style.color = lightColor;
                        });

                        elements.forEach((textElements) => {
                            textElements.style.color = lightColor;
                        });
                    } else {
                        darkM = false;
                        darkMode_cb.checked = false;
                    }
                }, 500);
            },
        }, {
            modName: "input filter",
            modType: "automatic",
            modDescription: "filters invalid input",
            modCode: () => {
                setTimeout(() => {
                    const kinputs = ["modinput1", "modinput2", "modinput3", "modinput4", "modinput5"];
                    kinputs.forEach((modkey) => {
                        const kinput = document.getElementById(modkey);
                        kinput.addEventListener("input", () => {
                            const lowercaseValue = kinput.value.toLowerCase();
                            if (kinput !== lowercaseValue) {
                                kinput.value = lowercaseValue;
                            }
                            if (kinput.value !== "") {
                                if (kinputs.filter((item) => item === kinput.value).length > 1) {
                                    alert("This value already exists!");
                                    kinput.value = "";
                                    return;
                                } else {
                                    kinputs.forEach((otherKey) => {
                                        const otherInput = document.getElementById(otherKey);
                                        if (otherInput !== kinput && otherInput.value === kinput.value) {
                                            alert("You can't have 2 keybindings at the same time.");
                                            kinput.value = "";
                                            return;
                                        }
                                    });
                                }
                            }
                        });
                    });
                }, 500);
            },
        }, {
            modName: "Map Customazation",
            modType: "automatic",
            modDescription: "Change background of map by image or color",
            modCode: () => {
                setTimeout(() => {
                    if (rxSettings.mapColor !== null) {
                    }
                    const mapColor = document.getElementById("mapColor");
                    const mapImage = document.getElementById("mapImage");
                    const originalFillRect = CanvasRenderingContext2D.prototype.fillRect;

                    function ChangeMapColor() {
                        CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
                            if ((width + height) / 2 === (window.innerWidth + window.innerHeight) / 2) {
                                this.fillStyle = mapColor.value;
                            }
                            originalFillRect.apply(this, arguments);
                        };
                        rxSettings.mapColor = mapColor.value;
                        localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
                    }

                    mapColor.addEventListener("input", ChangeMapColor);

                    function ChangeMapImage() {
                        const canvas = document.getElementById("canvas");
                        const ctx = canvas.getContext("2d");
                        const img = new Image();
                        let pattern;

                        img.onload = function () {
                            const tempCanvas = document.createElement("canvas");
                            const tempCtx = tempCanvas.getContext("2d");
                            tempCanvas.width = img.width;
                            tempCanvas.height = img.height;
                            tempCtx.drawImage(img, 0, 0);
                            pattern = ctx.createPattern(tempCanvas, "repeat");
                            fillCanvas();
                        };

                        function fillCanvas() {
                            const fillRect = CanvasRenderingContext2D.prototype.fillRect;
                            CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
                                this.fillStyle = pattern;
                                fillRect.apply(this, arguments);
                            };
                            ctx.fillRect(0, 0, canvas.width, canvas.height);
                        }
                        img.src = mapImage.value;
                    }

                    if (localStorage.getItem("rxSettings")) {
                        let rxSettings = JSON.parse(localStorage.getItem("rxSettings"));
                        function ChangeMapColor() {
                            CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
                                if ((width + height) / 2 === (window.innerWidth + window.innerHeight) / 2) {
                                    this.fillStyle = rxSettings.mapColor;
                                }
                                originalFillRect.apply(this, arguments);
                            };
                        }
                        ChangeMapColor();

                        function ChangeMapImage() {
                            const canvas = document.getElementById("canvas");
                            const ctx = canvas.getContext("2d");
                            const img = new Image();
                            let pattern;

                            img.onload = function () {
                                const tempCanvas = document.createElement("canvas");
                                const tempCtx = tempCanvas.getContext("2d");
                                tempCanvas.width = img.width;
                                tempCanvas.height = img.height;
                                tempCtx.drawImage(img, 0, 0);
                                pattern = ctx.createPattern(tempCanvas, "repeat");
                                fillCanvas();
                            };

                            function fillCanvas() {
                                const fillRect = CanvasRenderingContext2D.prototype.fillRect;
                                CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
                                    this.fillStyle = pattern;
                                    fillRect.apply(this, arguments);
                                };
                                ctx.fillRect(0, 0, canvas.width, canvas.height);
                            }
                            img.src = rxSettings.mapImageURL;
                        }
                        ChangeMapImage();
                    }
                }, 500);
            },
        }, {
            modName: "Set Image",
            modType: "menuMapButton",
            modDescription: "Mod Settings Button",
            modId: "setBG",
            modClass: "modButton",
            modCode: () => {
                const mapImage = document.getElementById("mapImage");
                if (rxSettings.mapColor !== null) {
                    if (confirm("You have applied a map color. Refresh the page to use an image as background. Reload?")) {
                        rxSettings.mapColor = null;
                        localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
                        location.reload();
                    } else {
                        return;
                    }
                } else {
                    function ChangeMapImage() {
                        const canvas = document.getElementById("canvas");
                        const ctx = canvas.getContext("2d");
                        const img = new Image();
                        let pattern;

                        img.onload = function () {
                            const tempCanvas = document.createElement("canvas");
                            const tempCtx = tempCanvas.getContext("2d");
                            tempCanvas.width = img.width;
                            tempCanvas.height = img.height;
                            tempCtx.drawImage(img, 0, 0);
                            pattern = ctx.createPattern(tempCanvas, "repeat");
                            fillCanvas();
                        };

                        function fillCanvas() {
                            const fillRect = CanvasRenderingContext2D.prototype.fillRect;
                            CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
                                this.fillStyle = pattern;
                                fillRect.apply(this, arguments);
                            };
                            ctx.fillRect(0, 0, canvas.width, canvas.height);
                        }
                        img.src = mapImage.value;
                    }
                    ChangeMapImage();
                }
                rxSettings.mapImageURL = mapImage.value;
                localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
            },
        }, {
            modName: "Remove Image",
            modType: "menuMapButton",
            modDescription: "Delete Image",
            modId: "delBG",
            modClass: "modButton",
            modCode: () => {
                if (document.getElementById("mapImage").value == "" || rxSettings.mapImageURL === "") return;
                if (confirm("You need to reload the page to remove the background image. Reload?") == true) {
                    rxSettings.mapImageURL = "";
                    localStorage.setItem("rxSettings", JSON.stringify(rxSettings));
                    location.reload();
                }
            },
        }, {
            modName: "",
            modType: "MapcolorButton",
            modDescription: "Reset Color",
            modId: "resetColor",
            modClass: "resetButton",
            modCode: () => {
                rxSettings.mapColor = null;
                localStorage.setItem("rxSettings", JSON.stringify(rxSettings));

                const mapColor = document.getElementById("mapColor");
                mapColor.value = "";
            },
        },
    ];

    rzMods.forEach((mod) => {
        let modElement = null;

        switch (mod.modType) {
            case "automatic":
                mod.modCode.call();

                break;
            case "menuMapButton":
                modElement = document.createElement("button");
                modElement.innerText = mod.modName;
                modElement.onclick = mod.modCode;
                modElement.title = mod.modDescription;
                modElement.id = mod.modId;
                modElement.classList.add(mod.modClass);
                modElement.type = "button";
                setTimeout(() => document.getElementById("mapimageDiv").append(modElement), 500);
                break;
            case "MapcolorButton":
                modElement = document.createElement("button");
                modElement.innerText = mod.modName;
                modElement.onclick = mod.modCode;
                modElement.title = mod.modDescription;
                modElement.id = mod.modId;
                modElement.classList.add(mod.modClass);
                modElement.type = "button";
                setTimeout(() => document.getElementById("mapcolorDiv").appendChild(modElement), 500);
                break;
        }
    });
    document.body.prepend(rzModSettings);
    let V2S = `
    *{
        outline: none;
    }
    .flex {
        display: flex;
        justify-content: center;
    }
    #rx-mod-settings {
        background: #333;
        padding: 30px;
        border-radius: 15px;
        width: 350px;
        min-height: 200px;
        top: 1em;
        left: 50%;
        margin-left: -175px;
        z-index: 99999;
        box-shadow: 0 0 40px #8D00FF;
        position: fixed;
        text-align: center;
    }
    #rx-mod-settings input.keybinding {
        max-width: 20px;
        border: 1px solid #ccc;
        padding: 0;
        text-align: center;
        margin-right: 5px;
        outline: none;
        color: #fff;
        background-color: transparent;
        border: 1px solid #fff;
        border-radius: 5px;
        font-weight: 500;
    }
    #rx-mod-settings.hidden {
        display: none;
    }

    #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
        display: none;
    }
    .cztop{
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .SettingsTitle{
        font-size: 32px;
        color: #EEE;
        margin-left: 10px;
    }
    .CloseBtn{
        outline: none;
        background-color: transparent;
        padding: 10px;
        font-size: 16px;
        transition: all .3s;
        color: #fff;
        border-radius: 15px;
        border: 2px solid #4C2B8D;
        width: 48px;
    }
    .CloseBtn:hover{
        border: 2px solid #5600FF;
    }
    .Sett{
        color: #fff;
        user-select: none;
        font-weight: 500;
    }
    .cztopleft{
        display: flex;
        align-items: center;
    }
    .titleImg{
        width: 50px;
        height: 50px;
        border-radius: 20px;
        object-fit: cover;
    }
    .modContainer {
        display: flex;
        justify-content: space-between;
    }
    .modButton{
        background-color: transparent;
        border: 1px solid #fff;
        border-radius: 5px;
        color: #fff;
        transition: all .3s;
        outline: none;
        padding: 5px;
        width: 60%;
        margin: 0 5px;
        font-size: 13px;
    }
    .modButton:hover {
        background-color: #5865F2;
    }
    .modInput {
        background-color: transparent;
        font-family: arial;
        border: 1px solid #fff;
        color: #fff;
        font-weight: 500;
        border-radius: 5px;
        padding: 4px;
        text-align: center;
    }

    #SettingsButton{
        background-color: transparent;
        height: 30px;
        background-image: url('https://i.ibb.co/pJhSvHJ/icons8-zahnrad-30.png');
        width: 30px;
        background-size: cover;
        border: none;
        outline: none;
        position: fixed;
        top: 15%;
        z-index:99997;
    }

    @media screen and (max-height: 800px) {
        #rx-mod-settings{
            top: 0
       }
    }

    .colorInput{
        background-color: transparent;
        width: 33px;
        height: 35px;
        border-radius: 50%;
        border: none;
    }

    .colorInput::-webkit-color-swatch {
      border-radius: 50%;
      border: 1px solid #000;
    }

    .resetButton {
        width: 25px;
        height: 25px;
        background-image: url("https://raw.githubusercontent.com/Sigmally/SigMod/main/images/reset.svg");
        background-color: transparent;
        border: none;
    }
    #mapcolorDiv {
        display: flex;
        justify-content: center;
        align-items: center;
    }
  `;

    let s = document.createElement("style");
    s.innerHTML = V2S;
    (document.head || document.documentElement).appendChild(s);
})();