Cookie clicker tools

Cookie clicker tools (visual)

当前为 2017-03-15 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Cookie clicker tools
// @namespace    orteil.dashnet.org
// @version      2.111
// @description  Cookie clicker tools (visual)
// @author       Anton
// @match        http://orteil.dashnet.org/cookieclicker/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    var log = [], logTitle = '<div class="section">Cookie clicker tools 2.111 is here!</div>', newLogs = 0;

    var started = false, t2, t3, tClick, tClickFrenzy, oldTitle = '', tLog,
        tPriority, tBankAuto, tAscendDetector, isClickingNow = false, tReloadPageOnWrongBuff;

    var _history = function() {
        var hist = [];
        hist.push('2.111 - option to buy infernal upgrades');
        hist.push('2.109 - kill all wrinklers button');
        hist.push('2.107 - click first 10 minutes after ascend');
        hist.push('2.101 - remove all bufs on negative multiplier (same as reload page)');
        hist.push('2.100 - Info section + ascend detector');
        hist.push('2.099 - mouse click upgrades');
        hist.push('2.097 - auto bank storage');
        hist.push('2.096 - buy objects more than 1');
        hist.push('2.091 - priority table refactor');
        hist.push('2.090 - buy very cheap items first');
        hist.push('2.086 - clear log button');
        hist.push('2.084 - buy unknown upgrades if their price is 0.1% of cookie storage');
        hist.push('2.083 - mouse upgrades is processed as Upgrades');
        hist.push('2.082 - start from scratch');
        hist.push('2.080 - add history, add option "showTimeCompensate"');
        hist.push('2.079 - hide donate box');
        hist.push('2.078 - Kittens now is processed as Upgrades');
        return hist;
    }

    var _getKittenPercentByUpgradeName = function(kName) {
        if (kName == 'Kitten helpers') return Game.milkProgress*0.1;
		if (kName == 'Kitten workers') return Game.milkProgress*0.125;
		if (kName == 'Kitten engineers') return Game.milkProgress*0.15;
		if (kName == 'Kitten overseers') return Game.milkProgress*0.175;
		if (kName == 'Kitten managers') return Game.milkProgress*0.2;
		if (kName == 'Kitten accountants') return Game.milkProgress*0.2;
		if (kName == 'Kitten specialists') return Game.milkProgress*0.2;
		if (kName == 'Kitten experts') return Game.milkProgress*0.2;
		if (kName == 'Kitten angels') return Game.milkProgress*0.1;
		return 0;
    }

    var options = {
        bankStoragePercent: 100,
        showTimeCompensate: false,
        bankStorageAuto: false,
        buyInfernalUpgrades: false
    };
    
    var _store = function(name, value) {
        if (typeof(Storage) !== "undefined") localStorage.setItem(name, value);
    };
    
    var _restore = function(name) {
        if (typeof(Storage) !== "undefined") return localStorage.getItem(name);
        else return undefined;
    };

    var _getBuffMult = function () {
        var buffMult = 1;
        for (var buff in Game.buffs) {
            if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
                buffMult = buffMult * Game.buffs[buff].multCpS;
            }
        }
        return buffMult === 0 ? 1 : buffMult;
    };

    var _getNormalCookiesPs = function () {
        return Game.cookiesPs > 0 ? Game.cookiesPs / _getBuffMult() : 1;
    };

    var _getMinimalMoney = function () {
        return Math.floor(_getNormalCookiesPs() * 42100 * options.bankStoragePercent / 100);
    };

    var _getMoneyCanSpend = function () {
        var moneyCanSpend = Game.cookies - _getMinimalMoney();
        return moneyCanSpend;
    };

    var _getWrinklerCount = function () {
        var wrinklersCount = 0;
        for (var i in Game.wrinklers) {
            if (Game.wrinklers[i].sucked > 0) {
                wrinklersCount++;
            }
        }
        return wrinklersCount;
    };

    var priorityListObj = {}, priorityList = [], timeCompensateObj = {}, timeCompensateList = [];
    var _createPriorityList = function() {
        var moneyCanSpend = _getMoneyCanSpend();
        var money = Game.cookies;
        var buffMult = _getBuffMult();
        priorityList = [];
        priorityListObj = {};
        for (var g in Game.UpgradesById) {
            if (Game.UpgradesById[g].bought === 0 && Game.UpgradesById[g].unlocked == 1) {
                var isMultiplier = Game.UpgradesById[g].desc.indexOf('production multiplier') >= 0;
                var isDouble = Game.UpgradesById[g].desc.indexOf('<b>twice</b>') >= 0;
                var isDoubleGrandma = Game.UpgradesById[g].desc.indexOf('Grandmas are <b>twice</b>') >= 0;
                var isKitten = Game.UpgradesById[g].name.indexOf('Kitten ') >= 0;
                var isDoubleCursor = Game.UpgradesById[g].desc.indexOf('The mouse and cursors are <b>twice</b>') >= 0;
                var isClickIncrease = Game.UpgradesById[g].desc.indexOf('Clicking gains <b>+1%') >= 0;
                var isSpecialTech = Game.UpgradesById[g].pool == 'tech' && typeof Game.UpgradesById[g].clickFunction !== 'undefined';
                if (isSpecialTech && Game.UpgradesById[g].clickFunction !== 'undefined' && options.buyInfernalUpgrades) {
                    delete(Game.UpgradesById[g].clickFunction);
                }
                var increasedMoney = 0;
                if (isClickIncrease) {
                    increasedMoney = Game.cookiesPs * 0.01;
                } else if (isDoubleCursor) {
                    increasedMoney = Game.Objects['Cursor'].storedTotalCps * Game.globalCpsMult / buffMult;
                } else if (isKitten) {
                    var kittenPercent = _getKittenPercentByUpgradeName(Game.UpgradesById[g].name);
                    increasedMoney = _getNormalCookiesPs() * kittenPercent;
                } else if (isDoubleGrandma) {
                    increasedMoney = Game.Objects['Grandma'].storedTotalCps * Game.globalCpsMult / buffMult;
                } else if (isMultiplier) {
                    increasedMoney = _getNormalCookiesPs() * Game.UpgradesById[g].power / 100;
                } else if (isDouble) {
                    increasedMoney = Game.UpgradesById[g].buildingTie.storedTotalCps * Game.globalCpsMult / buffMult;
                }
                var interest = increasedMoney > 0 ? Game.UpgradesById[g].getPrice() / increasedMoney : '-';
                if (interest != '-') {
                    if (typeof priorityListObj[Math.floor(interest)] === 'undefined') {
                        var pp = moneyCanSpend / Game.UpgradesById[g].getPrice(); // percent of cheapness
                        if (pp > 50) interest /= pp * 50;
                        priorityListObj[Math.floor(interest)] = {
                            name: Game.UpgradesById[g].name,
                            title: Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].getPrice()),
                            price: Game.UpgradesById[g].getPrice(),
                            cps: 1,
                            type: 'upgrade',
                            id: g,
                            income: increasedMoney
                        };
                    }
                } else if (Game.UpgradesById[g].type == 'upgrade' &&
                    Game.UpgradesById[g].getPrice() < moneyCanSpend &&
                    Game.UpgradesById[g].pool != 'toggle' && (!isSpecialTech || options.buyInfernalUpgrades))
                {
                    interest = Game.UpgradesById[g].getPrice() / moneyCanSpend * 1000;
                    if (typeof priorityListObj[Math.floor(interest)] === 'undefined') {
                        pp = moneyCanSpend / Game.UpgradesById[g].getPrice(); // percent of cheapness
                        if (pp > 50) interest /= pp * 50;
                        priorityListObj[Math.floor(interest)] = {
                            name: Game.UpgradesById[g].name,
                            title: Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].getPrice()),
                            price: Game.UpgradesById[g].getPrice(),
                            cps: 1,
                            type: 'upgrade',
                            id: g,
                            income: 0
                        };
                    }
                }
                //priorityList.push(Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].basePrice) + ' (INTEREST: ' + Beautify(interest) + ')');
            }
        }
        for (var i in Game.ObjectsById) {
            if (typeof i !== 'undefined' && i != 'undefined' && Game.ObjectsById.hasOwnProperty(i)) {
                if (Game.ObjectsById[i].locked === 0) {
                    var cps = (Game.ObjectsById[i].storedTotalCps / Game.ObjectsById[i].amount) * Game.globalCpsMult / buffMult;
                    interest = Game.ObjectsById[i].price / cps;
                    var pp = moneyCanSpend / Game.ObjectsById[i].price; // percent of cheapness
                    if (pp > 50) interest /= pp * 50;
                    if (isNaN(Math.floor(interest)) && Game.ObjectsById[i].price < moneyCanSpend) interest = 0;
                    priorityListObj[Math.floor(interest)] = {
                        name: Game.ObjectsById[i].name,
                        title: Game.ObjectsById[i].name + ' - ' + Beautify(Game.ObjectsById[i].price),
                        price: Game.ObjectsById[i].price,
                        cps: cps,
                        type: 'buy',
                        id: i,
                        income: cps
                    };
                    //priorityList.push(Game.ObjectsById[i].name + ' - ' + Beautify(Game.ObjectsById[i].price) + ' (INTEREST: ' + Beautify(interest) + ')');
                }
            }
        }
        for (i in priorityListObj) {
            var prefix = priorityListObj[i].price < moneyCanSpend ? '!!! ' : (priorityListObj[i].price < money ? '! ' : '');
            var pp = Math.floor(moneyCanSpend / priorityListObj[i].price * 100);
            priorityList.push(prefix + priorityListObj[i].title + ' : ' + i + ' (' + pp + '%)');
        }

        timeCompensateObj = {};
        timeCompensateList = [];
        for (i in priorityListObj) {
            var o = priorityListObj[i];
            if (o.type == 'buy') {
                var cpsWithPercent = (o.cps / _getNormalCookiesPs() + 1) * o.cps;
                var interestNew = o.price / cpsWithPercent;
                timeCompensateObj[Math.floor(interestNew)] = {
                    name: o.name,
                    title: o.title,
                    price: o.price,
                    cps: cpsWithPercent,
                    type: 'buy',
                    id: o.id,
                    income: o.income
                };
            } else {
                timeCompensateObj[i] = o;
            }
        }
        for (i in timeCompensateObj) {
            prefix = timeCompensateObj[i].price < moneyCanSpend ? '!!! ' : (timeCompensateObj[i].price < money ? '! ' : '');
            timeCompensateList.push(prefix + timeCompensateObj[i].title + ' : ' + i);
        }
    };

    var _caption = function(txt) {
        var $v = jQuery('#versionNumber');
        if ($v.text() != txt) $v.text(txt);
    };

    var _title = function(txt) {
        var newTitle = (newLogs > 0 ? '(' + newLogs + ') ' : '') + txt;
        if (document.title != newTitle) {
            oldTitle = txt;
            document.title = newTitle;
        }
    };

    var _titlePercent = function(have, need, txt) {
        var percent = Math.ceil(have / (need !== 0 ? need : 1) * 100);
        _title(String(percent) + "% - " + txt);
    };

    var _logSectionTitle = function (text) {
        return '<div class="title">' + text + '</div>';
    };

    var _logSection = function (title, items) {
        return '<div class="subsection">' + _logSectionTitle(title) +
            '<div class="listing">' + items.join('</div><div class="listing">') + '</div>' +
            '</div>';
    };
    
    var clearLogButton = '<button data-id="clearLog" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">Clear Log</button>';
    var killWrinklersButton = '<button data-id="killWrinklers" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">Kill wrinklers</button>';

    var _logPriorityTable = function() {
        var moneyCanSpend = _getMoneyCanSpend();
        var styles = '<style type="text/css">.prioritytable{width:100%;}.prioritytable td,.prioritytable th{padding:3px;}</style>';
        var t = '<table class="prioritytable"><tr style="border-bottom:1px solid;text-align:left;font-weight:bold;"><th>Type</th><th>Name</th><th>Price</th><th>Interest</th><th>Income</th><th>% bank</th></tr>';
        for (i in priorityListObj) {
            var o = priorityListObj[i];
            var pp = Math.floor(moneyCanSpend / o.price * 100);
            t += '<tr><td>' + o.type + '</td><td>' + o.name + '</td><td>' + Beautify(o.price) + '</td><td>' + i + '</td><td>' + Beautify(o.income) + '</td><td>' + pp + '</td></tr>';
        }
        t += '</table>';
        return styles + '<div class="subsection">' + _logSectionTitle('Priority ' + clearLogButton + ' ' + killWrinklersButton) + '<div class="listing">' + t + '</div></div>';
    }
    
    var _optionsSection = function() {
        var content = [];
        content.push('<label for="bankStoragePercent" id="bankStoragePercentLabel">Storage (' + Beautify(_getMinimalMoney()) + ') percent: ' + options.bankStoragePercent + '%</label> <input name="bankStoragePercent" id="bankStoragePercent" type="range" min="0" max="100" value="' + options.bankStoragePercent + '" onchange="document.getElementById(\'logButton\').onsliderchange(this)" />');
        content.push('<button data-id="showTimeCompensate" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">showTimeCompensate: ' + (options.showTimeCompensate ? 'TRUE' : 'FALSE') + '</button>');
        content.push('<button data-id="bankStorageAuto" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">bankStorageAuto: ' + (options.bankStorageAuto ? 'TRUE' : 'FALSE') + '</button>');
        content.push('<button data-id="buyInfernalUpgrades" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">buyInfernalUpgrades: ' + (options.buyInfernalUpgrades ? 'TRUE' : 'FALSE') + '</button>');
        content.push(clearLogButton);
        return content;
    };

    var _infoSection = function() {
        var content = [];
        
        var wrinklersTotal = 0;
        for (var i in Game.wrinklers) {
            wrinklersTotal += Game.wrinklers[i].sucked;
        }
        
        var chipsOwned = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
		var ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
		var ascendWillGet = ascendNowToOwn - chipsOwned;
		var cookiesToDoubleInitial = Game.HowManyCookiesReset(chipsOwned * 2) - (Game.cookiesEarned + Game.cookiesReset);
		var timeToReachDouble = Math.floor(cookiesToDoubleInitial / _getNormalCookiesPs());
			
        content.push('Now clicking: ' + (isClickingNow ? "YES" : "NO"));
        content.push('Cookies to double prestige: ' + Beautify(cookiesToDoubleInitial));
        content.push('Time to double prestige: ' + Game.sayTime(timeToReachDouble * Game.fps, 2));
        content.push('Heavenly chips in storage: ' + Game.heavenlyChips);
        content.push('You will get prestige by ascending: ' + ascendWillGet);
        content.push('Heavenly chips after ascend: ' + (Game.heavenlyChips + ascendWillGet));
        content.push('Buff mult: ' + _getBuffMult());
        content.push('Normal CpS: ' + Beautify(_getNormalCookiesPs()));
        content.push('Money bank: ' + Beautify(_getMinimalMoney()));
        content.push('Money can spend: ' + Beautify(_getMoneyCanSpend()));
        content.push('Wrinklers: ' + _getWrinklerCount());
        content.push('Wrinklers sucked: ' + Beautify(wrinklersTotal));
        return content;
    }

    var _updateLog = function () {
        Game.updateLog = logTitle +
            //_logSection('Priority ' + clearLogButton, priorityList) +
            _logPriorityTable() +
            (options.showTimeCompensate ? _logSection('Priority (time compensate)', timeCompensateList) : '') +
            _logSection('Info', _infoSection()) +
            _logSection('Log', log) +
            _logSection('Options', _optionsSection()) +
            _logSection('History', _history());
        var newButtonText = newLogs > 0 ? 'Log (' + newLogs + ')' : 'Log';
        if (jQuery('#logButton').text() != newButtonText) jQuery('#logButton').text(newButtonText);
        _title(oldTitle);
    };

    var _setBankStogarePercent = function(val, needUpdate) {
        if (options.bankStoragePercent != val) {
            if (needUpdate === true) jQuery('#bankStoragePercent').val(val);
            if (console) console.log('bankStoragePercent =', val);
            _store('bankStoragePercent', val);
            options.bankStoragePercent = val;
            jQuery('#bankStoragePercentLabel').text('Storage (' + Beautify(_getMinimalMoney()) + ') percent: ' + val + '%');
            _updateLog();
        }
    }

    document.getElementById('logButton').onsliderchange = function(el) {
        var val = $(el).val();
        _setBankStogarePercent(val);
    };

    var _bankAutoFunction = function() {
        if (options.bankStorageAuto && priorityList.length > 0 && Game.OnAscend == 0) {
            for (var idx in priorityListObj) {
                var bankStorageNew = Math.floor(idx / 50000);
                if (bankStorageNew > 100) bankStorageNew = 100;
                if (!isNaN(bankStorageNew)) _setBankStogarePercent(bankStorageNew, true);
                else if (console) console.log('bankStorageNew error:', idx);
                break;
            }
        }
    };

    var _addLog = function(text, notCritical) {
        var t = new Date();
        log.push(t.toUTCString() + ': ' + text);
        if (notCritical !== true) newLogs++;
        _updateLog();
    };

    jQuery('#logButton').text('Log').on("click", function() {
        newLogs = 0;
        jQuery('#logButton').text('Log');
    });

    var _killAllWrinklers = function (immediately) {
        if (typeof immediately === 'undefined') immediately = false;
        var wrinklersCount = _getWrinklerCount();
        if (wrinklersCount >= 10 || immediately === true) {
            var wrinklesIncome = 0;
            for (var i in Game.wrinklers) {
                wrinklesIncome += Game.wrinklers[i].sucked;
                Game.wrinklers[i].hp = 0; // kill ALL
            }
            if (wrinklesIncome > 0) {
                _addLog('Killed all Wrinkles for ' + Beautify(wrinklesIncome) + ' because of count 10.', true);
            }
        }
    };

    document.getElementById('logButton').onbuttonclick = function(el,e) {
        e.preventDefault();
        var id = jQuery(el).attr('data-id');
        if (id == 'showTimeCompensate') {
            options.showTimeCompensate = !options.showTimeCompensate;
            if (console) console.log('showTimeCompensate =', options.showTimeCompensate ? 'TRUE' : 'FALSE');
        } else if (id == 'bankStorageAuto') {
            options.bankStorageAuto = !options.bankStorageAuto;
            _store('bankStorageAuto', options.bankStorageAuto);
            if (console) console.log('bankStorageAuto =', options.bankStorageAuto ? 'TRUE' : 'FALSE');
            _bankAutoFunction();
        } else if (id == 'killWrinklers') {
            _killAllWrinklers(true);
        } else if (id == 'buyInfernalUpgrades') {
            options.buyInfernalUpgrades = !options.buyInfernalUpgrades;
            _store('buyInfernalUpgrades', options.buyInfernalUpgrades);
            if (console) console.log('buyInfernalUpgrades =', options.buyInfernalUpgrades ? 'TRUE' : 'FALSE');
        } else if (id == 'clearLog') {
            log = [];
            newLogs = 0;
        }
        jQuery(el).attr('disabled', 'disabled');
        _updateLog();
    }

    var _makeABuy = function() {

        _killAllWrinklers();

        var moneyCanSpend = _getMoneyCanSpend();

        if (moneyCanSpend < 0) {
            var minimalMoney = _getMinimalMoney();
            _caption('Collecting minimum ' + Beautify(minimalMoney));
            _titlePercent(Game.cookies, minimalMoney, 'minimum');
            return;
        }
        
        var needToBuy = undefined, needToBuyInterest = undefined;
        if (priorityList.length > 0) {
            for (var idx in priorityListObj) {
                needToBuy = priorityListObj[idx];
                needToBuyInterest = idx;
                if (needToBuy.type == 'upgrade') {
                    _caption('Upgrading ' + needToBuy.name + ' for ' + Beautify(needToBuy.price));
                    if (needToBuy.price < moneyCanSpend) {
                        if (Game.UpgradesById[needToBuy.id].canBuy()) {
                            Game.UpgradesById[needToBuy.id].buy();
                            _addLog('Buy upgrade ' + Game.UpgradesById[needToBuy.id].name + ' for ' + Beautify(needToBuy.price));
                            _createPriorityList();
                        }
                    } else {
                        _titlePercent(moneyCanSpend, needToBuy.price, Game.UpgradesById[needToBuy.id].name);
                    }
                } else {
                    _caption('Collecting ' + Beautify(needToBuy.price) + ' for ' + needToBuy.name);
                    if (Game.ObjectsById[needToBuy.id].price < moneyCanSpend) {
                        var amount = 1;
                        if (Game.ObjectsById[needToBuy.id].getSumPrice(100) < moneyCanSpend) {
                            Game.ObjectsById[needToBuy.id].buy(100);
                            amount = 100;
                        } else if (Game.ObjectsById[needToBuy.id].getSumPrice(10) < moneyCanSpend) {
                            Game.ObjectsById[needToBuy.id].buy(10);
                            amount = 10;
                        } else {
                            Game.ObjectsById[needToBuy.id].buy(1);
                        }
                        _addLog('Buy ' + amount + ' object ' + Game.ObjectsById[needToBuy.id].name + ' for ' + Beautify(Game.ObjectsById[needToBuy.id].price));
                        _createPriorityList();
                    } else {
                        _titlePercent(moneyCanSpend, needToBuy.price, Game.ObjectsById[needToBuy.id].name);
                    }
                }
                break;
            }
        }
    };

    var startT = function() {
        t2 = setInterval(_makeABuy, 500);

        started = true;
        _caption('Started');
        _addLog('Autobuy start!', true);
    };

    var stopT = function() {
        clearInterval(t2);
        started = false;
        _caption('Collecting gold...');
        _addLog('Autobuy stop.', true);
    };

    jQuery('#versionNumber').on("click", function() {
        if (!started)
            startT();
        else
            stopT();
    });

    options.bankStoragePercent = _restore('bankStoragePercent');
    if (typeof options.bankStoragePercent === 'undefined' || options.bankStoragePercent === null) {
        options.bankStoragePercent = 100;
    }
    options.bankStorageAuto = _restore('bankStorageAuto');
    if (typeof options.bankStorageAuto === 'undefined' || options.bankStorageAuto === null) {
        options.bankStorageAuto = false;
    }
    
    options.buyInfernalUpgrades = _restore('buyInfernalUpgrades');
    if (typeof options.buyInfernalUpgrades === 'undefined' || options.buyInfernalUpgrades === null) {
        options.buyInfernalUpgrades = false;
    }

    setTimeout(function() {
        jQuery('#donateBox').hide();
        
        tPriority = setInterval(function () {
            _createPriorityList();
            _updateLog();
        }, 1000);

        tLog = setInterval(function () {
            _updateLog();
        }, 600);

        tReloadPageOnWrongBuff = setInterval(function() {
            if (_getBuffMult() < 1) {
                var hasBuffsToKill = false;
                for (var buff in Game.buffs) {
                    if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
                        Game.buffs[buff].time = 0; // remove all buffs, not only negative (not cheating)
                        hasBuffsToKill = true;
                    }
                }
                if (hasBuffsToKill) _addLog('Remove all buffs because of negative multiplier', true);
            }
        }, 1000);

        tAscendDetector = setInterval(function() {
            if (Game.OnAscend == 1) {
                _setBankStogarePercent(0, true);
            }
        }, 1000);

        t3 = setInterval(function() {
            var golden = Game.shimmers;
            if (golden.length > 0) {
                for (var i in golden) {
                    golden[i].pop();
                }
            }
        }, 500);

        tBankAuto = setInterval(_bankAutoFunction, 600001); // 10 minutes

        tClickFrenzy = setInterval(function() {
            var date=new Date();
			date.setTime(Date.now()-Game.startDate);
			var seconds = date.getTime() / 1000;
            if (Game.hasBuff('Click frenzy') ||
                Game.hasBuff('Cursed finger') ||
                Game.hasBuff('Elder frenzy') ||
                Game.hasBuff('Dragon Harvest') ||
                Game.hasBuff('Dragonflight') ||
                Game.cookiesPs < 1000000 ||
                seconds < 600) {
                Game.ClickCookie();
                isClickingNow = true;
            } else {
                isClickingNow = false;
            }
        }, 75);

        if (Game.cookiesPs < 1E6) {
            tClick = setInterval(function() {
                Game.mouseX = jQuery('#bigCookie').width() / 2 + jQuery('#bigCookie').offset().left;
                Game.mouseY = jQuery('#bigCookie').height() / 2 + jQuery('#bigCookie').offset().top;
                Game.ClickCookie();
                if (Game.cookiesPs > 1E8) clearInterval(tClick);
            }, 300);
        }

        _caption('Collecting gold...');
        
        _bankAutoFunction();
    }, 5000);
})();