Last active
October 31, 2025 12:44
-
-
Save wilhelm-murdoch/6965a9cf9a36c9067745d9f53fe8cc4c to your computer and use it in GitHub Desktop.
Revisions
-
wilhelm-murdoch revised this gist
Oct 31, 2025 . 1 changed file with 6 additions and 34 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,17 @@ 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).`); } @@ -22,44 +20,18 @@ function startSessionClicker() { 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(); -
wilhelm-murdoch revised this gist
Oct 31, 2025 . 1 changed file with 30 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,19 @@ let clickerInterval = null; const targetText = "Start session"; const intervalMs = 10000; const REFRESH_STORAGE_KEY = 'autoClickerRefreshPending'; 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. The watch will continue.`); button.click(); return; } } console.log(`[AutoClicker] Button not found. Retrying in ${intervalMs / 1000} second(s).`); } @@ -20,22 +22,44 @@ function startSessionClicker() { console.warn("[AutoClicker] Clicker is already running. Stop it first using stopSessionClicker()."); return; } console.log(`[AutoClicker] Starting CONTINUOUS watch for button "${targetText}" every ${intervalMs}ms.`); clickerInterval = setInterval(attemptClick, intervalMs); } function stopSessionClicker() { if (clickerInterval) { clearInterval(clickerInterval); clickerInterval = null; console.log("[AutoClicker] Clicker STOPPED explicitly."); localStorage.removeItem(REFRESH_STORAGE_KEY); return true; } else { console.log("[AutoClicker] Clicker is not currently running."); return false; } } function refreshAndWatch() { console.log(`[AutoClicker] Preparing to refresh page and restart CONTINUOUS watch mode.`); stopSessionClicker(); localStorage.setItem(REFRESH_STORAGE_KEY, 'true'); console.log('[AutoClicker] Reloading page now...'); location.reload(); } function checkRefreshPersistence() { if (localStorage.getItem(REFRESH_STORAGE_KEY) === 'true') { localStorage.removeItem(REFRESH_STORAGE_KEY); console.log("[AutoClicker] Detected pending refresh state. Automatically starting clicker watch."); startSessionClicker(); } } console.log("--- Session Auto-Clicker Utility Loaded ---"); console.log(`Watch Interval: ${intervalMs / 1000} seconds. This script runs continuously until stopped.`); console.log(`Call \`startSessionClicker()\` to start watching immediately.`); console.log(`Call \`refreshAndWatch()\` to refresh the page and then automatically start watching.`); console.log(`Call \`stopSessionClicker()\` to manually stop the process and clear all flags.`); checkRefreshPersistence(); -
wilhelm-murdoch revised this gist
Oct 31, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ let clickerInterval = null; const targetText = "Start session"; const intervalMs = 10000; function attemptClick() { const buttons = document.querySelectorAll('button'); -
wilhelm-murdoch revised this gist
Oct 31, 2025 . 1 changed file with 1 addition and 25 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,51 +1,29 @@ let clickerInterval = null; const targetText = "Start session"; const intervalMs = 1000; 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); @@ -56,10 +34,8 @@ function stopSessionClicker() { } } console.log("--- Session Auto-Clicker Utility Loaded ---"); console.log(`Call \`startSessionClicker()\` to begin watching for the button "${targetText}".`); console.log(`Call \`stopSessionClicker()\` to manually stop the process.`); startSessionClicker(); -
wilhelm-murdoch created this gist
Oct 31, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ // --- Session Auto-Clicker Utility --- // This script is designed to run in the browser's Developer Tools Console. // It searches for a button with the exact text content "Start session" every second (1000ms). let clickerInterval = null; const targetText = "Start session"; const intervalMs = 1000; /** * Searches the DOM for a button with the target text content and clicks it. * Stops the interval upon a successful click to prevent unintended multiple actions. */ function attemptClick() { // Look for all button elements on the page const buttons = document.querySelectorAll('button'); // Iterate over the buttons to find the one with the exact text for (const button of buttons) { // Use trim() to handle potential leading/trailing whitespace if (button.textContent.trim() === targetText) { console.log(`[AutoClicker] Found button with text "${targetText}". Clicking now...`); // Simulate a click event button.click(); // Stop the clicker after a successful interaction stopSessionClicker(); return; // Exit the function after the click } } console.log(`[AutoClicker] Button not found. Retrying in ${intervalMs / 1000} second(s).`); } /** * Starts the interval to check for the button every second. */ 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.`); // Set up the interval timer clickerInterval = setInterval(attemptClick, intervalMs); } /** * Stops the running interval. */ function stopSessionClicker() { if (clickerInterval) { clearInterval(clickerInterval); clickerInterval = null; console.log("[AutoClicker] Clicker stopped."); } else { console.log("[AutoClicker] Clicker is not currently running."); } } // --- INITIALIZATION --- console.log("--- Session Auto-Clicker Utility Loaded ---"); console.log(`Call \`startSessionClicker()\` to begin watching for the button "${targetText}".`); console.log(`Call \`stopSessionClicker()\` to manually stop the process.`); // Automatically start the utility for convenience startSessionClicker();