Fps Menu for bloxd

Boost fps with these options on da menu (USE TAMPERMONKEY LEGACY IF YOU WANT IT TO WORK, and if you zoomined 140+ it will look weird)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Fps Menu for bloxd
// @namespace    http://tampermonkey.net/
// @version      05124.1
// @description  Boost fps with these options on da menu (USE TAMPERMONKEY LEGACY IF YOU WANT IT TO WORK, and if you zoomined 140+ it will look weird)
// @author       iTzPenzAr
// @match        *https://bloxd.io/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Create the button
    const button = document.createElement('button');
    button.innerHTML = 'Menu';
    button.style.position = 'fixed';
    button.style.bottom = '10px';
    button.style.right = '10px';
    button.style.padding = '10px 20px';
    button.style.backgroundColor = 'black';
    button.style.color = 'white';
    button.style.border = 'none';
    button.style.borderRadius = '5px';
    button.style.cursor = 'pointer';
    button.style.zIndex = '1000';

    document.body.appendChild(button);

    // Create the menu
    const menu = document.createElement('div');
    menu.style.position = 'fixed';
    menu.style.bottom = '50px';
    menu.style.right = '10px';
    menu.style.padding = '15px';
    menu.style.backgroundColor = 'black';
    menu.style.color = 'white';
    menu.style.border = '1px solid #fff';
    menu.style.borderRadius = '5px';
    menu.style.display = 'none';
    menu.style.zIndex = '1000';
    menu.style.width = '250px';

    // Create menu options
    const options = [
        { label: 'Stretch Screen', id: 'stretchScreen' },
        { label: 'FPS Booster', id: 'fpsBooster' },
        { label: 'FPS Counter', id: 'fpsCounter' },
    ];

    options.forEach(option => {
        const container = document.createElement('div');
        container.style.padding = '5px 0';

        const checkbox = document.createElement('input');
        checkbox.type = 'checkbox';
        checkbox.id = option.id;
        checkbox.style.marginRight = '10px';

        const label = document.createElement('label');
        label.htmlFor = option.id;
        label.innerText = option.label;

        container.appendChild(checkbox);
        container.appendChild(label);
        menu.appendChild(container);
    });

    document.body.appendChild(menu);

    // Toggle menu display
    button.addEventListener('click', () => {
        menu.style.display = menu.style.display === 'none' ? 'block' : 'none';
    });

    // Function to stretch the screen
    function stretchScreen() {
        document.documentElement.style.width = '100vw';
        document.documentElement.style.height = '100vh';
        document.documentElement.style.overflow = 'hidden';
        document.body.style.width = '100vw';
        document.body.style.height = '100vh';
        document.body.style.overflow = 'hidden';
    }

    // Function to boost FPS
    function boostFPS() {
        document.querySelectorAll('canvas').forEach(canvas => {
            canvas.style.imageRendering = 'pixelated';
            canvas.width = canvas.width / 2;
            canvas.height = canvas.height / 2;
        });
    }

    // Function to show FPS counter
    function showFPSCounter() {
        const script = document.createElement('script');
        script.innerHTML = `
            (function() {
                let lastFrameTime = performance.now();
                let frameCount = 0;
                let fpsDisplay = document.createElement('div');
                fpsDisplay.style.position = 'fixed';
                fpsDisplay.style.top = '10px';
                fpsDisplay.style.right = '10px';
                fpsDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
                fpsDisplay.style.color = 'white';
                fpsDisplay.style.padding = '5px';
                fpsDisplay.style.borderRadius = '5px';
                fpsDisplay.style.zIndex = '1000';
                document.body.appendChild(fpsDisplay);

                function updateFPS() {
                    let now = performance.now();
                    frameCount++;
                    if (now >= lastFrameTime + 1000) {
                        fpsDisplay.innerHTML = frameCount + ' FPS';
                        lastFrameTime = now;
                        frameCount = 0;
                    }
                    requestAnimationFrame(updateFPS);
                }
                updateFPS();
            })();
        `;
        document.body.appendChild(script);
    }

    // Function to show keyboard and mouse activity
    function showKeyboard() {
        const keyDisplay = document.createElement('div');
        keyDisplay.style.position = 'fixed';
        keyDisplay.style.bottom = '10px';
        keyDisplay.style.left = '10px';
        keyDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
        keyDisplay.style.color = 'white';
        keyDisplay.style.padding = '10px';
        keyDisplay.style.borderRadius = '5px';
        keyDisplay.style.zIndex = '1000';
        keyDisplay.style.width = '300px';
        keyDisplay.style.height = '100px';
        keyDisplay.style.overflowY = 'auto';
        keyDisplay.style.fontFamily = 'monospace';
        document.body.appendChild(keyDisplay);

        const mouseDisplay = document.createElement('div');
        mouseDisplay.style.position = 'fixed';
        mouseDisplay.style.top = '10px';
        mouseDisplay.style.left = '10px';
        mouseDisplay.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
        mouseDisplay.style.color = 'white';
        mouseDisplay.style.padding = '10px';
        mouseDisplay.style.borderRadius = '5px';
        mouseDisplay.style.zIndex = '1000';
        mouseDisplay.style.width = '150px';
        mouseDisplay.style.fontFamily = 'monospace';
        document.body.appendChild(mouseDisplay);

        document.addEventListener('keydown', (e) => {
            keyDisplay.innerText += `Key: ${e.key} (${e.code})\n`;
            keyDisplay.scrollTop = keyDisplay.scrollHeight;
        });

        document.addEventListener('mousedown', (e) => {
            mouseDisplay.innerText = `Mouse: Button ${e.button} Clicked\n`;
        });
    }

    // Function to log IPs
    function logIPs() {
        const logBox = document.createElement('div');
        logBox.style.position = 'fixed';
        logBox.style.bottom = '50px';
        logBox.style.left = '10px';
        logBox.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
        logBox.style.color = 'white';
        logBox.style.padding = '10px';
        logBox.style.borderRadius = '5px';
        logBox.style.zIndex = '1000';
        logBox.style.width = '300px';
        logBox.style.height = '400px';
        logBox.style.overflowY = 'auto';
        logBox.style.fontFamily = 'monospace';
        document.body.appendChild(logBox);

        const instructions = document.createElement('p');
        instructions.innerText = 'Press "O" to log IPs';
        instructions.style.color = 'green';
        logBox.appendChild(instructions);

        // Function to add IPs to the log
        function addIp(addr) {
            logBox.innerHTML += `<p style="color: white;">Got IP address: ${addr}</p>`;
            logBox.scrollTop = logBox.scrollHeight;
        }

        // Override RTCPeerConnection method to capture IP addresses
        const originalAddIceCandidate = RTCPeerConnection.prototype.addIceCandidate;
        RTCPeerConnection.prototype.addIceCandidate = function(...args) {
            if (args[0] && args[0].address && !args[0].address.includes(".local")) {
                addIp(args[0].address);
            }
            return originalAddIceCandidate.apply(this, args);
        };

        // Listen for keypress
        document.addEventListener('keydown', (e) => {
            if (e.key === 'O') {
                logBox.style.display = logBox.style.display === 'none' ? 'block' : 'none';
            }
        });
    }

    // Event listeners for the options
    document.getElementById('stretchScreen').addEventListener('change', (e) => {
        if (e.target.checked) {
            stretchScreen();
        } else {
            location.reload();
        }
    });

    document.getElementById('fpsBooster').addEventListener('change', (e) => {
        if (e.target.checked) {
            boostFPS();
        } else {
            location.reload();
        }
    });

    document.getElementById('fpsCounter').addEventListener('change', (e) => {
        if (e.target.checked) {
            showFPSCounter();
        } else {
            location.reload();
        }
    });

    document.getElementById('showKeyboard').addEventListener('change', (e) => {
        if (e.target.checked) {
            showKeyboard();
        } else {
            location.reload();
        }
    });

    document.getElementById('logIPs').addEventListener('change', (e) => {
        if (e.target.checked) {
            logIPs();
        } else {
            location.reload();
        }
    });

})();