Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
CookieBot = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cook as fast as possible!
}, 1);
this.goldenCookieInterval = setInterval(function(){
// Make the golden cookie show up
// Click the large cook as fast as possible!
}, 1000);
this.buyInterval = setInterval(function(){
// Now we need to buy stuff with our money.
// Start by trying to buy the most-expensive item
var last = []$$(".product.enabled")).reverse()[0];
if (last) {;
} else {
// Then try to buy the most expensive upgrade
var upgrade = []$$(".upgrade.enabled")).reverse()[0];
if (upgrade) {;
}, 30000);
stop: function() {

bernieperez commented Oct 9, 2013

How to use: Paste the following into the JavaScript console in your browser and run it.

To start the bot type: CookieBot.start();

To stop it do: CookieBot.stop(); (or just reload the page).


bernieperez commented Oct 9, 2013

Changes to John's original code:

  1. Waits 30 seconds to build up a bank before buying.
  2. Forces golden cookies to show up and clicks them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment