var clicksPerSecond = 240;
// calculate values for upgrades
function calculateUpgradeCps () {
// this list is far from complete, but it's enough to get you to 1 mil.
clicks = clicksPerSecond * Game.AchievementsById[78].won;
Game.UpgradesById[ 0].storedCps = (clicks + Game.Objects.Cursor.bought / 10);
Game.UpgradesById[ 1].storedCps = (clicks + Game.Objects.Cursor.bought / 10) * 2;
Game.UpgradesById[ 2].storedCps = (clicks + Game.Objects.Cursor.bought / 10) * 4;
Game.UpgradesById[ 7].storedCps = Game.Objects.Grandma.bought;
Game.UpgradesById[ 8].storedCps = Game.Objects.Grandma.bought * 2;
Game.UpgradesById[ 9].storedCps = Game.Objects.Grandma.bought * 4;
Game.UpgradesById[ 10].storedCps = Game.Objects.Farm.bought;
Game.UpgradesById[ 11].storedCps = Game.Objects.Farm.bought * 2;
Game.UpgradesById[ 12].storedCps = Game.Objects.Farm.bought * 4;
Game.UpgradesById[ 16].storedCps = Game.Objects.Mine.bought;
Game.UpgradesById[ 57].storedCps = Game.Objects.Grandma.bought * 8 + Game.Objects.Grandma.bought
* Game.Objects.Farm.bought * Game.Objects.Farm.storedCps / 100;
Game.UpgradesById[ 58].storedCps = Game.Objects.Grandma.bought * 16 + Game.Objects.Grandma.bought
* Game.Objects.Mine.bought * Game.Objects.Mine.storedCps / 100;
Game.UpgradesById[ 75].storedCps = clicks * Game.cookiesPs / 100;
}
calculateUpgradeCps();
function click (x) { x.click(); }
function clickAll (x) { Array.prototype.map.apply(x, [ click ]); }
bannedUpgrades = [
"Milk selector", "Background selector", "One mind", "Elder Pledge",
"Elder Covenant", "Communal brainsweep", "Elder Pact",
"Festive biscuit", "Ghostly biscuit", "Lovesick biscuit", "Fool's biscuit",
"Bunny biscuit", "Golden switch [off]", "Golden switch [on]",
"Golden cookie sound selector"
];
if (buyer) clearInterval(buyer);
buyer = setInterval(function () {
bestCps = 0;
for (i in Game.Objects) {
j = Game.Objects[i];
cpsPerPrice = j.storedCps / j.price;
span = document.querySelector("#productPrice" + j.id);
if (bestCps < cpsPerPrice) {
bestCps = cpsPerPrice;
best = j;
best_i = i;
bestSpan = span;
}
}
if (Game.AchievementsById[92].won || Game.prestige) do {
// in the event of sudden cash influx, buy all possible upgrades first
bought = false;
for (i in Game.Upgrades) {
if (bannedUpgrades.includes(i)) continue;
j = Game.Upgrades[i];
if (j.storedCps)
better = j.storedCps && j.storedCps / j.basePrice > bestCps;
worthit = !j.storedCps || better;
if (j.unlocked && !j.bought && worthit) {
j.buy();
if (j.bought) {
console.log("Bought " + i);
bought = true;
} else if (j.storedCps || best && best.price > j.basePrice)
best = undefined;
}
}
} while (bought);
if (best) {
//span.innerHTML = Beautify(j.price);
bestSpan.innerHTML = "-&gt; " + Beautify(best.price);
owned = best.bought;
best.buy();
if (owned < best.bought) {
console.log("Bought " + best_i);
calculateUpgradeCps();
}
}
}, 100);
if (clicker) clearInterval(clicker);
clicker = setInterval(function () {
if (Game.AchievementsById[78].won && !document.querySelector(".framed.prompt.onScreen"))
document.querySelector("#bigCookie").click();
//clickAll(document.querySelectorAll(".shimmer"));
}, 1000 / clicksPerSecond);
while (Game.cookies < 100) new Game.shimmer("reindeer").l.click();
if (goldenClicker) clearInterval(goldenClicker);
goldenClicker = setInterval(function () {
document.querySelectorAll(".shimmer").forEach(function (e) {
if (!e.clickable && e.style.opacity > 0.99) {
e.clickable = true;
console.log("Flagged cookie clickable at " + e.style.opacity + "% opacity");
console.log(e);
} else if (e.clickable && e.style.opacity < 0.2) {
e.click();
console.log("Clicked clickable cookie at " + e.style.opacity + "% opacity");
}
});
}, 10000 / clicksPerSecond);
Game.AchievementsById[204].click();
if (news) clearInterval(news);
news = setInterval(function () {
if (Game.AchievementsById[243].won) clearInterval(news);
else clickAll(document.querySelectorAll(".commentsText"));
});