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

Fully manage dragon including auras

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-04-20 07:19:48 +02:00
parent 9babcf1fa2
commit 8b6867a923
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Automate CookieClicker
// @namespace https://luzifer.io/
// @version 0.14.1
// @version 0.15.0
// @description Automate everything!
// @author Knut Ahlers <knut@ahlers.me>
// @source https://github.com/Luzifer/automate-cookie-clicker
@ -20,6 +20,10 @@ var blockingUpgrades = [
333, // Milk selector
414, // Background selector
];
var dragonAuras = [
10, // Golden cookies may trigger a Dragonflight.
15, // All cookie production multiplied by 2.
];
var purchaseSteps = 50;
function autoClick() {
@ -53,10 +57,7 @@ function executeAutoActions() {
note('Purchased ' + product.find('.title:first').text() + ' for you.');
}
// Upgrade dragon if possible
if (Game.dragonLevels[Game.dragonLevel].cost()) {
Game.UpgradeDragon()
}
manageDragon();
}
function controlAutoClicker() {
@ -102,6 +103,23 @@ function installHelper() {
window.autoPurchase = window.setInterval(executeAutoActions, 500);
}
function manageDragon() {
// Upgrade dragon if possible
if (Game.dragonLevels[Game.dragonLevel].cost()) {
Game.UpgradeDragon()
}
// Select first dragon aura
if (Game.dragonAura != dragonAuras[0] && Game.dragonLevel >= dragonAuras[0] + 4 && Game.SelectingDragonAura != dragonAura[0]) {
Game.SetDragonAura(dragonAuras[0], 0);
}
// Select second dragon aura
if (Game.dragonAura2 != dragonAuras[1] && Game.dragonLevel >= 22 && Game.SelectingDragonAura != dragonAura[1]) {
Game.SetDragonAura(dragonAuras[1], 1);
}
}
function note(msg, quick = true) {
// Icon: img/icons.png 0-based indices
Game.Notify("Auto-CookieClicker", msg, [12, 0], quick, true);