bloxd.io click booster

Utility Client for Bloxd.io / Steroids for bloxd.io

目前為 2025-03-31 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         bloxd.io click booster
// @namespace    https://bloxd.io
// @version      1.0.0
// @description  Utility Client for Bloxd.io  /  Steroids for bloxd.io
// @author       MakeItOrBreakIt
// @match        https://staging.bloxd.io/*
// @grant        none
// @license      MIT
// ==/UserScript==

(async function () {
    const LEFT_CLICK_TOGGLE_KEY = 'KeyR';
    const RIGHT_CLICK_TOGGLE_KEY = 'KeyF';
    let minCPS = 10, maxCPS = 15;
    const TARGET_SELECTOR = "#noa-canvas";

    let autoLeftClickEnabled = false;
    let autoRightClickEnabled = false;
    let autoLeftClickInterval;
    let autoRightClickInterval;

    console.log("Clicker booster loaded. Press 'R' for Left Click, 'F' for Right Click.");

    document.addEventListener("keydown", function (event) {
        if (event.repeat || event.target.tagName === 'INPUT' || event.target.tagName === 'TEXTAREA' || event.target.isContentEditable) return;
        if (event.code === LEFT_CLICK_TOGGLE_KEY) toggleAutoLeftClick();
        if (event.code === RIGHT_CLICK_TOGGLE_KEY) toggleAutoRightClick();
    });

    function randomInterval() {
        return 1000 / (Math.random() * (maxCPS - minCPS) + minCPS);
    }

    function toggleAutoLeftClick() {
        if (autoRightClickEnabled) stopRightClicker();
        autoLeftClickEnabled ? stopLeftClicker() : startLeftClicker();
    }

    function startLeftClicker() {
        autoLeftClickEnabled = true;
        console.log("Auto LEFT-Clicker ENABLED");
        autoLeftClickInterval = setInterval(() => simulateClick(0), randomInterval());
    }

    function stopLeftClicker() {
        clearInterval(autoLeftClickInterval);
        autoLeftClickEnabled = false;
        console.log("Auto LEFT-Clicker DISABLED");
    }

    function toggleAutoRightClick() {
        if (autoLeftClickEnabled) stopLeftClicker();
        autoRightClickEnabled ? stopRightClicker() : startRightClicker();
    }

    function startRightClicker() {
        autoRightClickEnabled = true;
        console.log("Auto RIGHT-Clicker ENABLED");
        autoRightClickInterval = setInterval(() => simulateClick(2), randomInterval());
    }

    function stopRightClicker() {
        clearInterval(autoRightClickInterval);
        autoRightClickEnabled = false;
        console.log("Auto RIGHT-Clicker DISABLED");
    }

    function simulateClick(button) {
        let element = document.querySelector(TARGET_SELECTOR);
        if (!element) return;
        element.dispatchEvent(new MouseEvent("mousedown", { button, bubbles: true, cancelable: true, view: window }));
        element.dispatchEvent(new MouseEvent("mouseup", { button, bubbles: true, cancelable: true, view: window }));
        if (button === 0) element.dispatchEvent(new MouseEvent("click", { button, bubbles: true, cancelable: true, view: window }));
        if (button === 2) element.dispatchEvent(new MouseEvent("contextmenu", { button, bubbles: true, cancelable: true, view: window }));
    }

    function clearCookies() {
        document.cookie.split(";").forEach(cookie => {
            document.cookie = cookie.split("=")[0] + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/";
        });
        console.log("Cookies cleared, new account can be generated.");
    }

    function createUI() {
        let ui = document.createElement("div");
        ui.innerHTML = `
            <div style="position: fixed; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.7); color: white; padding: 10px; border-radius: 5px; z-index: 9999;">
                <button id="leftClickToggle">Left Click</button>
                <button id="rightClickToggle">Right Click</button>
                <button id="clearCookies">Gen Account</button>
                <br><br>
                <label>Min CPS: <input type="number" id="minCPS" value="10" min="1" max="50"></label>
                <label>Max CPS: <input type="number" id="maxCPS" value="15" min="1" max="50"></label>
            </div>
        `;
        document.body.appendChild(ui);
        document.getElementById("leftClickToggle").onclick = toggleAutoLeftClick;
        document.getElementById("rightClickToggle").onclick = toggleAutoRightClick;
        document.getElementById("clearCookies").onclick = clearCookies;
        document.getElementById("minCPS").onchange = (e) => minCPS = parseInt(e.target.value);
        document.getElementById("maxCPS").onchange = (e) => maxCPS = parseInt(e.target.value);
    }

    if (/Mobi|Android/i.test(navigator.userAgent)) {
        console.log("Mobile support is kinda there, but it won't work with Tampermonkey.");
    } else {
        createUI();
    }
})();