Auto Click Target on Mouse Accuracy

Auto click targets in Mouse Accuracy with better accuracy

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Auto Click Target on Mouse Accuracy
// @namespace    http://tampermonkey.net/
// @version      2.3
// @description  Auto click targets in Mouse Accuracy with better accuracy
// @author       HưngVN
// @license      MIT
// @match        https://mouseaccuracy.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const clickedTargets = new Set(); // Lưu các target đã bấm

    // Hàm mô phỏng click chuột
    function simulateMouseEvent(element, eventType) {
        const mouseEvent = new MouseEvent(eventType, {
            bubbles: true,
            cancelable: true,
            view: window,
        });
        element.dispatchEvent(mouseEvent);
    }

    // Hàm tự động click vào target hợp lệ
    function autoClickTarget() {
        const targets = document.querySelectorAll('.target');
        targets.forEach((target) => {
            if (
                document.body.contains(target) && // Kiểm tra target còn tồn tại
                !clickedTargets.has(target) // Đảm bảo chưa click vào target này
            ) {
                simulateMouseEvent(target, 'mousedown');
                simulateMouseEvent(target, 'mouseup');
                simulateMouseEvent(target, 'click');
                clickedTargets.add(target); // Đánh dấu đã click
                console.log('Đã click vào target mới!');
            }
        });

        // Liên tục chạy lại kiểm tra target
        requestAnimationFrame(autoClickTarget);
    }

    // Khởi chạy vòng lặp auto-click
    requestAnimationFrame(autoClickTarget);
})();