Last active
December 26, 2015 20:39
-
-
Save jhubert/7210277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CookieBot = { | |
| start: function() { | |
| this.clickInterval = setInterval(function(){ | |
| // Click the large cook as fast as possible! | |
| $("#bigCookie").click(); | |
| }, 1); | |
| this.goldenCookieInterval = setInterval(function(){ | |
| // Sometimes a golden cookie will appear to give you a bonus | |
| // Click that a bunch of times! | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| $("#goldenCookie").click(); | |
| }, 1000); | |
| }, | |
| stop: function() { | |
| clearInterval(this.clickInterval); | |
| clearInterval(this.goldenCookieInterval); | |
| } | |
| }; | |
| CookieBot.start(); | |
| BuyCookieBot = { | |
| start: function() { | |
| this.buyInterval = setInterval(function(){ | |
| // Now we need to buy stuff with our money. | |
| // Start by trying to buy the most-expensive item | |
| var last = [].slice.call($$(".product.enabled")).reverse()[0]; | |
| if (last) { | |
| last.click(); | |
| } else { | |
| // Then try to buy the most expensive upgrade | |
| var upgrade = [].slice.call($$(".upgrade.enabled")).reverse()[0]; | |
| if (upgrade) { | |
| upgrade.click(); | |
| } | |
| } | |
| }, 50); | |
| }, | |
| stop: function() { | |
| clearInterval(this.buyInterval); | |
| } | |
| }; | |
| BuyCookieBot.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment