mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-12-22 18:21:18 +00:00
Fully manage dragon including auras
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
9babcf1fa2
commit
8b6867a923
1 changed files with 23 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Automate CookieClicker
|
// @name Automate CookieClicker
|
||||||
// @namespace https://luzifer.io/
|
// @namespace https://luzifer.io/
|
||||||
// @version 0.14.1
|
// @version 0.15.0
|
||||||
// @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
|
||||||
|
@ -20,6 +20,10 @@ var blockingUpgrades = [
|
||||||
333, // Milk selector
|
333, // Milk selector
|
||||||
414, // Background selector
|
414, // Background selector
|
||||||
];
|
];
|
||||||
|
var dragonAuras = [
|
||||||
|
10, // Golden cookies may trigger a Dragonflight.
|
||||||
|
15, // All cookie production multiplied by 2.
|
||||||
|
];
|
||||||
var purchaseSteps = 50;
|
var purchaseSteps = 50;
|
||||||
|
|
||||||
function autoClick() {
|
function autoClick() {
|
||||||
|
@ -53,10 +57,7 @@ function executeAutoActions() {
|
||||||
note('Purchased ' + product.find('.title:first').text() + ' for you.');
|
note('Purchased ' + product.find('.title:first').text() + ' for you.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upgrade dragon if possible
|
manageDragon();
|
||||||
if (Game.dragonLevels[Game.dragonLevel].cost()) {
|
|
||||||
Game.UpgradeDragon()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function controlAutoClicker() {
|
function controlAutoClicker() {
|
||||||
|
@ -102,6 +103,23 @@ function installHelper() {
|
||||||
window.autoPurchase = window.setInterval(executeAutoActions, 500);
|
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) {
|
function note(msg, quick = true) {
|
||||||
// Icon: img/icons.png 0-based indices
|
// Icon: img/icons.png 0-based indices
|
||||||
Game.Notify("Auto-CookieClicker", msg, [12, 0], quick, true);
|
Game.Notify("Auto-CookieClicker", msg, [12, 0], quick, true);
|
||||||
|
|
Loading…
Reference in a new issue