Continious Simulate Click on Horizontal Arrow

Simulate clicks on div elements with specific class and style

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Continious Simulate Click on Horizontal Arrow
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Simulate clicks on div elements with specific class and style
// @author       max5555
// @match        https://cab.meest.cn/dashboard/buyout
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Inject the radial button
    const radialBtn = document.createElement('button');
    radialBtn.textContent = "Toggle Continuous Clicks";
    radialBtn.style.position = "fixed";
    radialBtn.style.bottom = "10px";
    radialBtn.style.right = "10px";
    radialBtn.style.zIndex = "10000";
    radialBtn.style.borderRadius = "50%";
    radialBtn.style.background = "red";
    radialBtn.style.color = "white";
    radialBtn.style.border = "none";
    radialBtn.style.padding = "10px 20px";
    document.body.appendChild(radialBtn);

    let clicking = false;
    let clickInterval;

    // Function to simulate clicks
    function simulateClicks() {
        const divs = document.querySelectorAll('div.horizontal-arrow:not(.clicked)'); // Select divs that have not been clicked
        divs.forEach(div => {
            if (div.style.transform === "rotate(0deg)") {
                div.click();
                div.classList.add('clicked'); // Mark the div as clicked
            }
        });
    }

    // Add event listener for the radial button
    radialBtn.addEventListener('click', function() {
        clicking = !clicking;
        if (clicking) {
            clickInterval = setInterval(simulateClicks, 1000); // Simulate click every 1 second
            radialBtn.style.background = "green";
        } else {
            clearInterval(clickInterval);
            radialBtn.style.background = "red";
            // Optional: Remove the 'clicked' class from all divs if you want to reset the state when stopping
            document.querySelectorAll('div.horizontal-arrow.clicked').forEach(div => {
                div.classList.remove('clicked');
            });
        }
    });

})();