Mouse-Follow Auto Clicker (Smooth + Burst, Max 10k CPS)

Mouse-following auto clicker with both smooth and burst modes. Max CPS 10,000. Toggle with Q.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Mouse-Follow Auto Clicker (Smooth + Burst, Max 10k CPS)
// @namespace    http://tampermonkey.net/
// @version      8.0
// @description  Mouse-following auto clicker with both smooth and burst modes. Max CPS 10,000. Toggle with Q.
// @author       LigHT (modified by TheHackerClient and gpt)
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    let running = false;
    let cps = 100;
    let smoothInterval = null;
    let burstInterval = null;
    let lastMouseX = 0, lastMouseY = 0;

    // Track mouse
    document.addEventListener("mousemove", e => {
        lastMouseX = e.clientX;
        lastMouseY = e.clientY;
    });

    // Toggle with Q
    document.addEventListener("keyup", function(evt) {
        if (evt.key.toLowerCase() === "q") {
            if (!running) {
                // Turn ON
                running = true;

                let inp = prompt("Enter CPS (1–10000, default 100):", cps);
                if (!isNaN(inp) && inp.trim().length > 0) {
                    inp = parseInt(inp);
                    if (inp > 10000) cps = 10000;
                    else if (inp < 1) cps = 1;
                    else cps = inp;
                }

                alert(`Auto Clicker started at ${cps} CPS. Press Q again to stop.`);

                // --- Smooth clicks (evenly spaced) ---
                let smoothIntervalMs = 1000 / cps;
                smoothInterval = setInterval(() => {
                    simulateClick(lastMouseX, lastMouseY);
                }, smoothIntervalMs);

                // --- Burst clicks (chunked every 100ms) ---
                burstInterval = setInterval(() => {
                    let clicksPerBurst = Math.ceil(cps / 10);
                    for (let i = 0; i < clicksPerBurst; i++) {
                        simulateClick(lastMouseX, lastMouseY);
                    }
                }, 100);

            } else {
                // Turn OFF
                running = false;
                clearInterval(smoothInterval);
                clearInterval(burstInterval);
                alert("Auto Clicker stopped.");
            }
        }
    });

    function simulateClick(x, y) {
        let el = document.elementFromPoint(x, y);
        if (!el) return;
        let ev = new MouseEvent("click", {
            view: window,
            bubbles: true,
            cancelable: true,
            clientX: x,
            clientY: y
        });
        el.dispatchEvent(ev);
    }
})();