Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple bot for CookieClicker: http://orteil.dashnet.org/cookieclicker/ How to use: Paste the following into the JavaScript console in your browser and run it. To start the bot type: "CookieClicker.start();" to stop it do: "CookieClicker.stop();" (or just reload the page).
CookieClicker = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cookie as fast as possible!
document.getElementById("bigCookie").click();
}, 1);
this.goldInterval = setInterval(function(){
// Click the golden cookie
var shimmer = document.getElementsByClassName("shimmer")[0];
if (shimmer) {
shimmer.click();
}
}, 1000);
},
stop: function() {
clearInterval(this.clickInterval);
clearInterval(this.goldInterval);
}
};
UpgradeClicker = {
start: function() {
this.buyInterval = setInterval(function(){
// Now we need to buy stuff with our money.
// Then try to buy the most expensive upgrade
var upgrade = [].slice.call(document.querySelectorAll(".upgrade.enabled")).reverse()[0];
if (upgrade) {
upgrade.click();
} else {
// Then try to buy the most-expensive item
var last = [].slice.call(document.querySelectorAll(".product.enabled")).reverse()[0];
if (last) {
last.click();
}
}
}, 10000);
},
stop: function() {
clearInterval(this.buyInterval);
}
};
@jeresig

This comment has been minimized.

Copy link
Owner Author

@jeresig jeresig commented Sep 26, 2013

Simple bot for CookieClicker: http://orteil.dashnet.org/cookieclicker/

How to use: Paste the following into the JavaScript console in your browser and run it.
To start the bot type: CookieClicker.start();
To stop it do: CookieClicker.stop(); (or just reload the page).

@RamyTalal

This comment has been minimized.

Copy link

@RamyTalal RamyTalal commented Sep 27, 2013

Why not just Game.RuinTheFun();?

@iconmaster5326

This comment has been minimized.

Copy link

@iconmaster5326 iconmaster5326 commented Sep 30, 2013

Just buying the most expensive item is a bad strategy. Things should be bought using cookies per cps; predictive, like Cookie Monster does. Or even more powerful, delta cps per second.

@ob-ivan

This comment has been minimized.

Copy link

@ob-ivan ob-ivan commented Oct 2, 2013

I prefer "delta cps per cookie". In the beginning buying a cursor gives you 0.1 cps for 15 cookies, that is, about 6.67 mcps/c, and hiring a grandma gives you 0.5 cps for 100 cookies, that is, 5 mcps/c, which makes cursor more effective. But as soon as you have 3 cursors, buying one more cursor costs you 22.8 cookies, which makes its efficiency below 5 mcps/c (4.38 mcps/c to be a bit more exact), which justifies waiting for 100 cookies in bank to hire a grandma rather than to spend all your income on cheap and ineffective labour force.

@dieseltravis

This comment has been minimized.

Copy link

@dieseltravis dieseltravis commented Oct 2, 2013

@iconmaster5326 & @ob-ivan great points! I look forward to your forks ;-)

@ob-ivan

This comment has been minimized.

Copy link

@ob-ivan ob-ivan commented Oct 3, 2013

https://gist.github.com/ob-ivan/6800011 -- something like that, I suppose.

@DevL0rd

This comment has been minimized.

Copy link

@DevL0rd DevL0rd commented Jun 26, 2020

Try this one. Made it recently in a contest against friends.
https://github.com/DevL0rd/Cookie-Clicker-Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.