melon client || bloxd.io cheats

like steroids for bloxd.io

目前为 2024-12-18 提交的版本。查看 最新版本

// ==UserScript==
// @name         melon client || bloxd.io cheats
// @namespace    http://bloxd.io
// @version      2024-12-18
// @description  like steroids for bloxd.io
// @author       officiallymelon
// @match        https://bloxd.io
// @icon         https://github.com/OfficiallyMelon/files-cdn/blob/main/bloxd_io/melon.png?raw=true
// @grant        none
// @run-at       document-start
// @license GPL-3.0-or-later
// ==/UserScript==

(function() {
    (() => {
        const img = document.createElement('img');
        img.src = 'https://github.com/OfficiallyMelon/files-cdn/blob/main/Credits.png?raw=true';
        img.style.position = 'fixed';
        img.style.bottom = '10px';
        img.style.right = '10px';
        img.style.width = '350px';
        img.style.height = 'auto';
        img.style.zIndex = '10000';
        document.body.appendChild(img);
    })();

    const loadGoogleFont = (fontName) => {
        const link = document.createElement('link');
        link.href = `https://fonts.googleapis.com/css2?family=${fontName.replace(/ /g, '+')}`;
        link.rel = 'stylesheet';
        document.head.appendChild(link);
    };
    loadGoogleFont('Roboto');

    const MelonMenu = () => {
        const menu = document.createElement('div');
        menu.style.position = 'fixed';
        menu.style.top = '20px';
        menu.style.left = '20px';
        menu.style.width = '800px';
        menu.style.backgroundColor = '#F7B2BD';
        menu.style.border = '2px solid #ffffff';
        menu.style.color = '#ffffff';
        menu.style.fontFamily = "'Roboto', Arial, sans-serif";
        menu.style.fontSize = '14px';
        menu.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.5)';
        menu.style.borderRadius = '8px';
        menu.style.zIndex = '10000';
        menu.style.padding = '10px';
        menu.style.cursor = 'move';

        const tabs = ['World', 'Player', 'Movement', 'Misc'];
        const tabContainer = document.createElement('div');
        tabContainer.style.display = 'flex';
        tabContainer.style.justifyContent = 'space-around';
        tabContainer.style.backgroundColor = '#E34A6F';
        tabContainer.style.padding = '5px';
        tabContainer.style.borderRadius = '5px 5px 0 0';
        tabContainer.style.marginBottom = '10px';

        tabs.forEach((tab) => {
            const tabElement = document.createElement('div');
            tabElement.textContent = tab;
            tabElement.style.color = '#ffffff';
            tabElement.style.cursor = 'pointer';
            tabElement.style.padding = '5px 10px';
            tabElement.style.fontWeight = 'bold';
            tabElement.style.borderRadius = '4px';
            tabElement.style.transition = 'background-color 0.3s';
            tabElement.style.fontFamily = "'Roboto', Arial, sans-serif";
            tabContainer.appendChild(tabElement);
        });

        menu.appendChild(tabContainer);

        const columnsContainer = document.createElement('div');
        columnsContainer.style.display = 'flex';
        columnsContainer.style.justifyContent = 'space-between';
        columnsContainer.style.gap = '10px';

        const columnData = [
            ['Scaffold'],
            ['Reach'],
            ['Speed', 'High Jump', 'Infinite Jump'],
            ['AccGen'],
        ];

        const loadButtonStates = () => {
            return JSON.parse(localStorage.getItem('buttonStates') || '{}');
        };

        const saveButtonStates = (states) => {
            localStorage.setItem('buttonStates', JSON.stringify(states));
        };

        const buttonStates = loadButtonStates();
        const buttonsMap = {};

        columnData.forEach((columnItems) => {
            const column = document.createElement('div');
            column.style.flex = '1';
            column.style.backgroundColor = '#F7B2BD';
            column.style.padding = '0px';
            column.style.borderRadius = '0px';

            columnItems.forEach((item) => {
                const itemElement = document.createElement('div');
                itemElement.textContent = item;
                itemElement.style.backgroundColor = buttonStates[item] ? '#4E954F' : '#F7B2BD';
                itemElement.style.margin = '0px 0';
                itemElement.style.padding = '5px';
                itemElement.style.borderRadius = '0px';
                itemElement.style.textAlign = 'center';
                itemElement.style.cursor = 'pointer';
                itemElement.style.transition = 'background-color 0.1s';
                itemElement.style.fontFamily = "'Roboto', Arial, sans-serif";

                let isSelected = !!buttonStates[item];

                itemElement.onmouseover = () => {
                    if (!isSelected) itemElement.style.backgroundColor = '#4E954F';
                };
                itemElement.onmouseout = () => {
                    if (!isSelected) itemElement.style.backgroundColor = '#F7B2BD';
                };

                itemElement.onclick = () => {
                    isSelected = !isSelected;
                    itemElement.style.backgroundColor = isSelected ? '#4E954F' : '#F7B2BD';
                    buttonStates[item] = isSelected;
                    saveButtonStates(buttonStates);

                    if (item === 'AccGen') {
                        document.cookie.split(';').forEach((cookie) => {
                            if (cookie.trim().startsWith('___Secure-3PSIDMC=')) {
                                document.cookie = cookie.split('=')[0] + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/';
                            }
                        });
                        location.reload();
                    }
                    if (item === 'Speed') {
                        window.GlobalSpeed = isSelected ? 7.5 : 5;
                    }
                    if (item === 'Infinite Jump') {
                        window.AirJump = isSelected ? 999999999999 : 0;
                    }
                    if (item === 'High Jump') {
                        window.JumpAmount = isSelected ? 3 : 0;
                    }
                    if (item === 'Reach') {
                        window.Reach = isSelected ? true : false;
                    }
                    if (item === 'Scaffold') {
                        window.scaffold = isSelected ? true : false;
                    }
                };

                column.appendChild(itemElement);
                buttonsMap[item] = itemElement;
            });

            columnsContainer.appendChild(column);
        });

        menu.appendChild(columnsContainer);

        let isDragging = false;
        let offsetX, offsetY;

        menu.addEventListener('mousedown', (e) => {
            isDragging = true;
            offsetX = e.clientX - menu.offsetLeft;
            offsetY = e.clientY - menu.offsetTop;
            menu.style.transition = 'none';
        });

        document.addEventListener('mousemove', (e) => {
            if (isDragging) {
                menu.style.left = `${e.clientX - offsetX}px`;
                menu.style.top = `${e.clientY - offsetY}px`;
            }
        });

        document.addEventListener('mouseup', () => {
            isDragging = false;
        });

        document.body.appendChild(menu);

        document.addEventListener('keydown', (e) => {
            if (e.ctrlKey && e.key.toLowerCase() === 'c') {
                const scaffoldButton = buttonsMap['Scaffold'];
                if (scaffoldButton) {
                    scaffoldButton.click();
                }
            }
        });
    };
    MelonMenu();
})();