Skip to content

Instantly share code, notes, and snippets.

@wilhelm-murdoch
Last active October 31, 2025 12:44
Show Gist options
  • Select an option

  • Save wilhelm-murdoch/6965a9cf9a36c9067745d9f53fe8cc4c to your computer and use it in GitHub Desktop.

Select an option

Save wilhelm-murdoch/6965a9cf9a36c9067745d9f53fe8cc4c to your computer and use it in GitHub Desktop.
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