Skip to content

Instantly share code, notes, and snippets.

@ccb9921
Created October 30, 2020 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccb9921/56e05df53585f16a02ba5cd0d469e82f to your computer and use it in GitHub Desktop.
Save ccb9921/56e05df53585f16a02ba5cd0d469e82f to your computer and use it in GitHub Desktop.
Cookie Clicker Autoclicker
/**
* Auto Cookie Clicker
* Auto click cookies and golden cookies in the Cookie Clicker
* game found here: http://orteil.dashnet.org/cookieclicker/
*/
/**
* How to in Chrome:
* Open the browers and navigate to http://orteil.dashnet.org/cookieclicker/
* then pressCTRL + SHIFT + J to open the developer console. Copy and paste the
* code between the "Auto Clicker" tags and press enter and the auto clicker will begin clicking. To stop
* the auto clicker, simply close your browers tab or refresh the page.
*/
/* ******************** Auto Clicker ******************** */
function clickId(id) {
var element = document.getElementById(id);
if(element !== undefined) {
doEvent(element, "click");
}
window.setTimeout(clickId, 25, id);
}
function doEvent(element, type) {
trigger = document.createEvent('HTMLEvents');
trigger.initEvent(type, true, true);
element.dispatchEvent(trigger);
}
window.setTimeout(clickId, 25, "bigCookie");
window.setTimeout(clickId, 25, "goldenCookie");
/* ****************** End Auto Clicker ****************** */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment