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 passionate about technology and building products. A web design business created while attending college slowly evolved into a brick and mortar on Main St. of his small Midwestern hometown. His desire for fame and fortune led to the co-founding of a Y Combinator startup and a life in California.
Hey there! I'm currently writing a book on Microservices which I expect to release in early 2017. If you're interested in getting updates please signup here. More info about the Book
  • 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