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.

6 Responses to “Cheating at Cookie Clicker”

  1. Steve Lacy

    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. :)

    Reply
  2. 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

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>