Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.setInterval(
- function () {
- var findMin = function (arr, id) {
- var minPrice = Number.POSITIVE_INFINITY;
- arr.forEach(function (obj) {
- if (obj[id] < minPrice && obj[id] > 0) {
- minPrice = obj[id];
- }
- });
- return minPrice;
- }
- var clickCheck = function(id) {
- var thing = $(id);
- if (thing) { thing.click(); }
- }
- var minObjectPrice = findMin(Game.ObjectsById, 'bulkPrice');
- var minUpgradePrice = findMin(Game.UpgradesInStore, 'basePrice');
- window.debug.minObjectPrice = minObjectPrice;
- window.debug.minUpgradePrice = minUpgradePrice;
- var proximityThreshold = 0.1;
- if (minUpgradePrice * (1 - proximityThreshold) < minObjectPrice) {
- clickCheck('.crate.upgrade.enabled:not(.selector)');
- } else {
- clickCheck('.product.unlocked.enabled');
- }
- clickCheck('#goldenCookie');
- clickCheck('#bigCookie');
- }
- , 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement