Cheating at Cookie Clicker
Support this website by purchasing prints of my photographs! Check them out here.A friend linked to this game the other day:
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.