mirror of
https://github.com/Luzifer/automate-cookie-clicker.git
synced 2024-12-22 18:21:18 +00:00
Also purchase techUpgrades
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c44f6ebeb1
commit
a129004819
1 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Automate CookieClicker
|
// @name Automate CookieClicker
|
||||||
// @namespace https://luzifer.io/
|
// @namespace https://luzifer.io/
|
||||||
// @version 0.6.4
|
// @version 0.7.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
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
GM_addStyle('@import url("https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css");');
|
GM_addStyle('@import url("https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css");');
|
||||||
|
|
||||||
|
var blockingUpgrades = [];
|
||||||
var purchaseSteps = 50;
|
var purchaseSteps = 50;
|
||||||
|
|
||||||
function autoClick() {
|
function autoClick() {
|
||||||
|
@ -23,7 +24,7 @@ function autoClick() {
|
||||||
|
|
||||||
function autoPurchaseUpgrades() {
|
function autoPurchaseUpgrades() {
|
||||||
// Look for upgrades being available
|
// Look for upgrades being available
|
||||||
let availableUpgrades = $('#upgrades > .upgrade.enabled');
|
let availableUpgrades = $('.upgrade.enabled').filter(upgradeFilter);
|
||||||
if (availableUpgrades.length > 0) {
|
if (availableUpgrades.length > 0) {
|
||||||
debug(availableUpgrades.length + " upgrades available, buying now...");
|
debug(availableUpgrades.length + " upgrades available, buying now...");
|
||||||
availableUpgrades.click();
|
availableUpgrades.click();
|
||||||
|
@ -104,3 +105,8 @@ function getMaxBuy() {
|
||||||
let version = GM_info.script.version;
|
let version = GM_info.script.version;
|
||||||
toastr.info('Auto-CookieClicker ' + version + ' loaded.');
|
toastr.info('Auto-CookieClicker ' + version + ' loaded.');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
function upgradeFilter(idx) {
|
||||||
|
var upgradeID = parseInt($(this).attr('onclick').replace(/^.*\[([0-9]+)\].*$/, "$1"))
|
||||||
|
return !blockingUpgrades.includes(upgradeID);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue