Repuls.io QoL (Fixed)

Adds FPS counter, crosshair, and auto-respawn overlays for Repuls.io

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Repuls.io QoL (Fixed)
// @namespace    repuls-qol-fixed
// @version      1.1
// @description  Adds FPS counter, crosshair, and auto-respawn overlays for Repuls.io
// @match        https://repuls.io/*
// @run-at       document-end
// @grant        none
// ==/UserScript==
(function () {
    'use strict';

    // Wait until body exists
    function ready(fn) {
        if (document.body) fn();
        else setTimeout(() => ready(fn), 100);
    }

    ready(() => {
        console.log('[Repuls QoL] Script started');

        /* ---------- FPS COUNTER ---------- */
        const fpsBox = document.createElement('div');
        fpsBox.textContent = 'FPS: --';
        fpsBox.style.position = 'fixed';
        fpsBox.style.top = '10px';
        fpsBox.style.right = '10px';
        fpsBox.style.color = '#00ff00';
        fpsBox.style.background = 'rgba(0,0,0,0.6)';
        fpsBox.style.font = '12px monospace';
        fpsBox.style.padding = '6px';
        fpsBox.style.zIndex = '2147483647';
        document.body.appendChild(fpsBox);

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

        function fpsLoop(now) {
            frames++;
            if (now - last >= 1000) {
                fpsBox.textContent = 'FPS: ' + frames;
                frames = 0;
                last = now;
            }
            requestAnimationFrame(fpsLoop);
        }
        requestAnimationFrame(fpsLoop);

        /* ---------- CROSSHAIR ---------- */
        const crosshair = document.createElement('div');
        crosshair.style.position = 'fixed';
        crosshair.style.left = '50%';
        crosshair.style.top = '50%';
        crosshair.style.width = '10px';
        crosshair.style.height = '10px';
        crosshair.style.border = '2px solid cyan';
        crosshair.style.transform = 'translate(-50%, -50%)';
        crosshair.style.pointerEvents = 'none';
        crosshair.style.zIndex = '2147483646';
        document.body.appendChild(crosshair);

        /* ---------- KEYBINDS ---------- */
        document.addEventListener('keydown', e => {
            if (e.code === 'KeyC') {
                crosshair.style.display =
                    crosshair.style.display === 'none' ? 'block' : 'none';
            }
            if (e.code === 'KeyF') {
                fpsBox.style.display =
                    fpsBox.style.display === 'none' ? 'block' : 'none';
            }
        });

        /* ---------- AUTO RESPAWN ---------- */
        setInterval(() => {
            const btns = document.getElementsByTagName('button');
            for (const b of btns) {
                if (b.innerText && b.innerText.toLowerCase().includes('respawn')) {
                    b.click();
                    break;
                }
            }
        }, 1200);

        console.log('[Repuls QoL] Loaded successfully');
    });
})();