Continious Simulate Click on Horizontal Arrow

Simulate clicks on div elements with specific class and style

  1. // ==UserScript==
  2. // @name Continious Simulate Click on Horizontal Arrow
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Simulate clicks on div elements with specific class and style
  6. // @author max5555
  7. // @match https://cab.meest.cn/dashboard/buyout
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Inject the radial button
  16. const radialBtn = document.createElement('button');
  17. radialBtn.textContent = "Toggle Continuous Clicks";
  18. radialBtn.style.position = "fixed";
  19. radialBtn.style.bottom = "10px";
  20. radialBtn.style.right = "10px";
  21. radialBtn.style.zIndex = "10000";
  22. radialBtn.style.borderRadius = "50%";
  23. radialBtn.style.background = "red";
  24. radialBtn.style.color = "white";
  25. radialBtn.style.border = "none";
  26. radialBtn.style.padding = "10px 20px";
  27. document.body.appendChild(radialBtn);
  28.  
  29. let clicking = false;
  30. let clickInterval;
  31.  
  32. // Function to simulate clicks
  33. function simulateClicks() {
  34. const divs = document.querySelectorAll('div.horizontal-arrow:not(.clicked)'); // Select divs that have not been clicked
  35. divs.forEach(div => {
  36. if (div.style.transform === "rotate(0deg)") {
  37. div.click();
  38. div.classList.add('clicked'); // Mark the div as clicked
  39. }
  40. });
  41. }
  42.  
  43. // Add event listener for the radial button
  44. radialBtn.addEventListener('click', function() {
  45. clicking = !clicking;
  46. if (clicking) {
  47. clickInterval = setInterval(simulateClicks, 1000); // Simulate click every 1 second
  48. radialBtn.style.background = "green";
  49. } else {
  50. clearInterval(clickInterval);
  51. radialBtn.style.background = "red";
  52. // Optional: Remove the 'clicked' class from all divs if you want to reset the state when stopping
  53. document.querySelectorAll('div.horizontal-arrow.clicked').forEach(div => {
  54. div.classList.remove('clicked');
  55. });
  56. }
  57. });
  58.  
  59. })();