Last active
January 10, 2025 20:31
-
-
Save brianarn/6d8d799b129a63f965d92e8c6e33ea97 to your computer and use it in GitHub Desktop.
Revisions
-
brianarn revised this gist
Jan 10, 2025 . 1 changed file with 10 additions and 4 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 @@ -25,18 +25,21 @@ window._stimAuto = (function () { // Also, we don't want to select the ocean button, as we never want to click that automatically const upgradeButtonSelector = `.upgrade:not(.upgrade-disabled) .upgrade-icon:not(${oceanAttr})`; // There are also powerups that we want to click on const powerupSelector = "img.powerup"; // Given our selectors, make our main query const buttonsQuery = `${buttonSelectors .map((item) => `${item}:not(${item}-hide)`) .join(", ")}, ${upgradeButtonSelector}, ${powerupSelector}`; function clickEverything() { document.querySelectorAll(buttonsQuery).forEach((button) => { button.click(); }); } function startAutomation(stopAtOcean = true) { if (intervalID) { console.log("Trying to start automation but it's already running"); return; @@ -50,8 +53,9 @@ window._stimAuto = (function () { return; } if (stopAtOcean && document.querySelector(oceanEnabled)) { console.log("The ocean button is enabled, stopping."); console.log("If you wish to restart while still skipping the ocean, run _stimAuto.start(false)"); clearAutomationInterval(); return; } @@ -65,6 +69,8 @@ window._stimAuto = (function () { clearInterval(intervalID); intervalID = null; } // The object that exposes our public methods const stimAuto = { start: startAutomation, stop: clearAutomationInterval, -
brianarn revised this gist
Jan 10, 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 @@ -8,7 +8,7 @@ window._stimAuto = (function () { let intervalID = null; const titleSelector = ".title-screen"; const oceanAttr = '[src$="ocean.webp"]'; const oceanEnabled = `.upgrade:not(.upgrade-disabled) > .upgrade-icon${oceanAttr}`; const buttonSelectors = [ ".main-btn", // The main button -
brianarn revised this gist
Jan 10, 2025 . 1 changed file with 13 additions and 9 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 @@ -7,6 +7,9 @@ window._stimAuto = (function () { const intervalMS = 10; let intervalID = null; const titleSelector = ".title-screen"; const oceanAttr = `[src$="ocean.webp"]`; const oceanEnabled = `.upgrade:not(.upgrade-disabled) > .upgrade-icon${oceanAttr}`; const buttonSelectors = [ ".main-btn", // The main button ".collect", // Collecting the leveling reward @@ -17,19 +20,20 @@ window._stimAuto = (function () { ".action-btn", // Feed the chicken ".egg", // Collect the kinder eggs ]; // Upgrade buttons are special, since they don't use -hide but have a -disabled parent // Also, we don't want to select the ocean button, as we never want to click that automatically const upgradeButtonSelector = `.upgrade:not(.upgrade-disabled) .upgrade-icon:not(${oceanAttr})`; // Given our selectors, make our main query const buttonsQuery = `${buttonSelectors .map((item) => `${item}:not(${item}-hide)`) .join(", ")}, ${upgradeButtonSelector}`; function clickEverything() { document.querySelectorAll(buttonsQuery).forEach((button) => { button.click(); }); } function startAutomation() { -
brianarn revised this gist
Jan 10, 2025 . 2 changed files with 16 additions and 4 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 @@ -2,4 +2,6 @@ This is a script that attempts to click all the things in stimulation clicker for you, turning it into more of an idle game. Be warned, it makes a HORRIBLE noise since it's clicking so rapidly. It's set to _not_ click the ocean button for you, but will stop automation when the ocean button is detected and not disabled. 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 @@ -9,7 +9,6 @@ window._stimAuto = (function () { const buttonSelectors = [ ".main-btn", // The main button ".collect", // Collecting the leveling reward ".press-collect", // Collecting the hydraulic press ".press-btn", // Start the hydraulic press @@ -19,13 +18,18 @@ window._stimAuto = (function () { ".egg", // Collect the kinder eggs ]; const titleSelector = ".title-screen"; const oceanAttr = `[src$="ocean.webp"]`; const oceanEnabled = `.upgrade:not(.upgrade-disabled) > .upgrade-icon${oceanAttr}` let buttonsQuery = buttonSelectors .map((item) => `${item}:not(${item}-hide)`) .join(","); // Upgrade icons are handled more uniquely, as we don't want to click the ocean endgame icon buttonsQuery = `${buttonsQuery},.upgrade-icon:not(.upgrade-icon-hide,${oceanAttr})`; function clickEverything() { document.querySelectorAll(buttonsQuery).forEach((button) => { button.click() }); } function startAutomation() { @@ -42,6 +46,12 @@ window._stimAuto = (function () { return; } if (document.querySelector(oceanEnabled)) { console.log("The ocean button is enabled, stopping"); clearAutomationInterval(); return; } clickEverything(); }, intervalMS); } -
brianarn created this gist
Jan 10, 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,5 @@ # Stimulation Clicker Automated This is a script that attempts to click all the things in stimulation clicker for you, turning it into more of an idle game. Be warned, it makes a HORRIBLE noise since it's clicking so rapidly. 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,62 @@ /* * Stimulation Clicker Automator * by Brian Sinclair (@brianarn) * MIT License, do whatever */ window._stimAuto = (function () { const intervalMS = 10; let intervalID = null; const buttonSelectors = [ ".main-btn", // The main button ".upgrade-icon", // The various upgrades ".collect", // Collecting the leveling reward ".press-collect", // Collecting the hydraulic press ".press-btn", // Start the hydraulic press ".loot-box-target", // Loot boxes ".question-choice", // Duolingo options ".action-btn", // Feed the chicken ".egg", // Collect the kinder eggs ]; const titleSelector = ".title-screen"; const buttonsQuery = buttonSelectors .map((item) => `${item}:not(${item}-hide)`) .join(","); function clickEverything() { document.querySelectorAll(buttonsQuery).forEach((button) => button.click()); } function startAutomation() { if (intervalID) { console.log("Trying to start automation but it's already running"); return; } console.log("Starting automation..."); intervalID = setInterval(() => { if (document.querySelector(titleSelector)) { console.log("Title screen detected, stopping"); clearAutomationInterval(); return; } clickEverything(); }, intervalMS); } function clearAutomationInterval() { console.log("Clearing automation interval"); clearInterval(intervalID); intervalID = null; } const stimAuto = { start: startAutomation, stop: clearAutomationInterval, }; stimAuto.start(); return stimAuto; })();