Continious Simulate Click on Horizontal Arrow

Simulate clicks on div elements with specific class and style

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

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

})();