Posted by & filed under JavaScript.

A friend linked to this game the other day:

Cookie Clicker

It’s really simple. You click something over and over, and you buy upgrades, and then some automated processes happen in the background.

Open your console, and paste in the following commands. They will allow you to play the game automatically. Notice the $$; this uses MooTools, not jQuery.

// Automatically purchase new products (e.g. Grandmas) each second as they become available
setInterval(function() { $$('.product.enabled')[0].click(); }, 1000);

// Automatically click the big cookie 10 times per second
setInterval(function() {$('#bigCookie').click();}, 100);

// Automatically purchase upgrades each second as they become available
setInterval(function() { $$('.upgrade.enabled')[0].click(); }, 1000);

These simple commands don’t play the game as efficiently as possible. One could graph out the best way to play the game, which would involve saving up for better options instead of always spending money.

For Cookie Clicker to prevent this easy way of cheating the game, they’d probably want to not load MooTools as a global object, and randomize the names of DOM elements each time the game is loaded. Those wouldn’t prevent these cheats 100%, but it would make them harder to perform.

Thomas Hunter II

Thomas is a published author and a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.
  • Another, possibly even easier way to cheat, is to use the “Export” function, and take the resultant string, base64 decode it, modify the internal values, and then re-encode and “Import Save” that way. It’s fairly easy to tweak the numbers and get pretty much whatever you want. :)

  • zaku

    how turn off

  • Kira

    Yeah, how do i turn off the cheats? Refresh didn’t help :C

    • It is impossible for the cheats to keep running after doing a refresh

  • skittles forthewin

    is their an auto raindeer click???????

  • nathan

    thanks it was really helpful I try to hack after I beat things but I tried to go on yutube and and avery one was wrong that I got so thanks

  • it dosnt work