1
0
mirror of https://github.com/Luzifer/automate-cookie-clicker.git synced 2024-09-19 15:23:02 +00:00

Remove aura set, fix building buy

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-04-20 09:07:48 +02:00
parent 25fbc3b767
commit b274868b2b
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Automate CookieClicker // @name Automate CookieClicker
// @namespace https://luzifer.io/ // @namespace https://luzifer.io/
// @version 0.17.1 // @version 0.17.2
// @description Automate everything! // @description Automate everything!
// @author Knut Ahlers <knut@ahlers.me> // @author Knut Ahlers <knut@ahlers.me>
// @source https://github.com/Luzifer/automate-cookie-clicker // @source https://github.com/Luzifer/automate-cookie-clicker
@ -21,10 +21,6 @@ let blockingUpgrades = [
333, // Milk selector 333, // Milk selector
414, // Background selector 414, // Background selector
]; ];
let dragonAuras = [
10, // Golden cookies may trigger a Dragonflight.
15, // All cookie production multiplied by 2.
];
let purchaseSteps = 50; let purchaseSteps = 50;
function autoClick() { function autoClick() {
@ -57,14 +53,13 @@ function executeAutoActions() {
while (availableProducts.length > 0 && Game.buyMode === 1) { // buyMode 1 = buy, -1 = sell while (availableProducts.length > 0 && Game.buyMode === 1) { // buyMode 1 = buy, -1 = sell
let product = availableProducts[availableProducts.length - 1]; let product = availableProducts[availableProducts.length - 1];
let buyAmount = 0; for (let buyAmount = getMaxBuy() - product.amount; buyAmount > 0; buyAmount--) {
for (buyAmount = purchaseSteps - product.amount; buyAmount > 0; buyAmount--) {
if (product.getSumPrice(buyAmount) <= Game.cookies) { if (product.getSumPrice(buyAmount) <= Game.cookies) {
product.buy(buyAmount);
break; break;
} }
} }
product.buy(buyAmount);
availableProducts = Game.ObjectsById.filter(obj => obj.price < Game.cookies && obj.amount < getMaxBuy()); availableProducts = Game.ObjectsById.filter(obj => obj.price < Game.cookies && obj.amount < getMaxBuy());
} }
@ -114,15 +109,8 @@ function manageDragon() {
Game.UpgradeDragon(); Game.UpgradeDragon();
} }
// Select first dragon aura // Choosing dragon aura is currently not possible :(
if (Game.dragonAura !== dragonAuras[0] && Game.dragonLevel >= dragonAuras[0] + 4 && Game.SelectingDragonAura !== dragonAuras[0]) { // This will just open a select dialogue...
Game.SetDragonAura(dragonAuras[0], 0);
}
// Select second dragon aura
if (Game.dragonAura2 !== dragonAuras[1] && Game.dragonLevel >= 22 && Game.SelectingDragonAura !== dragonAuras[1]) {
Game.SetDragonAura(dragonAuras[1], 1);
}
} }
function note(msg, quick = true) { function note(msg, quick = true) {