tampermonekey autoclicker script // ==UserScript== // @name Auto Click "Next Page" with Countdown Timer Sync // @namespace http://tampermonkey.net/ // @version 1.5 // @description Clicks "Next Page" when countdown timer reaches 00:00 // @author Prajan Shrestha // @match https://app.aarpdriversafety.org/courseflow/* // @grant none // ==/UserScript== (function() { tampermonekey autoclicker script PasteShr tampermonekey autoclicker script 'use strict'; console.log("Tampermonkey script is running..."); // Simulate a natural click function simulateClick(element) { const event = new MouseEvent("click", { bubbles: true, cancelable: true, view: window tampermonekey autoclicker script How to dowload it? tampermonekey autoclicker script }); element.dispatchEvent(event); } // Check timer and click button function checkTimerAndClick() { const timer = document.querySelector("[data-test='courseTimer']"); const button = document.getElementById("arrow-next"); // Wait for timer to appear tampermonekey autoclicker script PasteShr tampermonekey autoclicker script if (!timer) { console.log("Timer not found yet. Retrying in 1.5s..."); setTimeout(checkTimerAndClick, 1500); return; } const time = timer.textContent.trim(); // e.g., "00:00" console.log(`Current timer value: ${time}`); // Wait for button to appear tampermonekey autoclicker script How to get it? tampermonekey autoclicker script if (!button) { console.log("Button not found. Retrying in 1.5s..."); setTimeout(checkTimerAndClick, 1500); return; } // When timer hits 00:00 and button is enabled, click it if (time === "00:00" && !button.disabled) { console.log("Timer at 00:00 and button enabled. Clicking now..."); simulateClick(button); tampermonekey autoclicker script How to get it? tampermonekey autoclicker script setTimeout(checkTimerAndClick, 2000); // Check again after 2s for next page } else { if (button.disabled) { console.log("Button is disabled. Waiting for timer to reach 00:00... (retrying in 1.5s)"); } else { console.log(`Timer at ${time}, waiting for 00:00... (retrying in 1.5s)`); } setTimeout(checkTimerAndClick, 1500); // Retry every 1.5s } } tampermonekey autoclicker script PasteShr tampermonekey autoclicker script // Start the script console.log("Starting script. Waiting for timer and button..."); setTimeout(checkTimerAndClick, 1500); // Initial delay to let page load })(); tampermonekey autoclicker script