Last active
October 31, 2025 12:44
-
-
Save wilhelm-murdoch/6965a9cf9a36c9067745d9f53fe8cc4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let clickerInterval = null; | |
| const targetText = "Start session"; | |
| const intervalMs = 30000; | |
| function attemptClick() { | |
| const buttons = document.querySelectorAll('button'); | |
| for (const button of buttons) { | |
| if (button.textContent.trim() === targetText) { | |
| console.log(`[AutoClicker] Found button with text "${targetText}". Clicking now...`); | |
| button.click(); | |
| return; | |
| } | |
| } | |
| console.log(`[AutoClicker] Button not found. Retrying in ${intervalMs / 1000} second(s).`); | |
| } | |
| function startSessionClicker() { | |
| if (clickerInterval) { | |
| console.warn("[AutoClicker] Clicker is already running. Stop it first using stopSessionClicker()."); | |
| return; | |
| } | |
| console.log(`[AutoClicker] Starting to watch for button "${targetText}" every ${intervalMs}ms.`); | |
| clickerInterval = setInterval(attemptClick, intervalMs); | |
| } | |
| function stopSessionClicker() { | |
| if (clickerInterval) { | |
| clearInterval(clickerInterval); | |
| clickerInterval = null; | |
| console.log("[AutoClicker] Clicker stopped."); | |
| } else { | |
| console.log("[AutoClicker] Clicker is not currently running."); | |
| } | |
| } | |
| startSessionClicker(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment