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

Use notify and intialize later

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-04-14 18:26:46 +02:00
parent 093f537fd0
commit 3428830df3
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.9.2 // @version 0.9.3
// @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
@ -78,9 +78,20 @@ function getMaxBuy() {
return Math.max(Math.ceil((topPurchaseCount + 1) / purchaseSteps), 1) * purchaseSteps; return Math.max(Math.ceil((topPurchaseCount + 1) / purchaseSteps), 1) * purchaseSteps;
} }
function installHelper() {
// Startup notification
let version = GM_info.script.version;
note('Version ' + version + ' loaded.');
window.checkCPS = window.setInterval(checkCPS, 1000);
// Enable automatic purchasing of upgrades / elements
window.autoPurchase = window.setInterval(executeAutoActions, 500);
}
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.Note("Auto-CookieClicker", msg, [12, 0], quick); Game.Notify("Auto-CookieClicker", msg, [12, 0], quick);
} }
function upgradeFilter(idx) { function upgradeFilter(idx) {
@ -95,14 +106,5 @@ function upgradeFilter(idx) {
(function() { (function() {
'use strict'; 'use strict';
window.checkCPS = window.setInterval(checkCPS, 1000); window.setTimeout(installHelper, 1000);
// Enable automatic purchasing of upgrades / elements
window.autoPurchase = window.setInterval(executeAutoActions, 500);
window.setTimeout(function() {
// Startup notification
let version = GM_info.script.version;
note('Version ' + version + ' loaded.');
}, 1000);
})(); })();