Auto Click Target on Mouse Accuracy

Auto click targets in Mouse Accuracy with better accuracy

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);
})();