Cookie clicker tools

Cookie clicker tools (visual)

当前为 2018-12-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Cookie clicker tools
  3. // @namespace orteil.dashnet.org
  4. // @version 2.181
  5. // @description Cookie clicker tools (visual)
  6. // @author Anton
  7. // @match http://orteil.dashnet.org/cookieclicker/*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. var tAutoBuy, tPopGolden, tClickFrenzy, oldTitle = '',
  14. tPriority, tBankAuto, tAscendDetector, isClickingNow = false,
  15. tSeasonSwitcher, tDragon, tReloadPageOnWrongBuff, tAutoClickInterval = 75;
  16.  
  17. var _GameHelpers = {
  18. isHardcore: function () {
  19. return parseInt(Game.ascensionMode) === 1
  20. && !Game.HasAchiev('Hardcore')
  21. && Game.HasAchiev('True Neverclick');
  22. },
  23. isNeverclick: function () {
  24. return parseInt(Game.ascensionMode) === 1
  25. && !Game.HasAchiev('True Neverclick');
  26. },
  27. isAscend: function () {
  28. return parseInt(Game.OnAscend) === 1;
  29. },
  30. hasDragon: function () {
  31. return Game.Has('A crumbly egg');
  32. },
  33. getMilkMult: function() {
  34. var milkMult = 1;
  35. if (Game.Has('Santa\'s milk and cookies')) milkMult *= 1.05;
  36. if (Game.hasAura('Breath of Milk')) milkMult *= 1.05;
  37. milkMult *= Game.eff('milk');
  38. return milkMult;
  39. },
  40. getKittenPercentByUpgradeName: function(kName) {
  41. var milkMult = _GameHelpers.getMilkMult();
  42. if (kName === 'Kitten helpers') return Game.milkProgress*0.1*milkMult;
  43. if (kName === 'Kitten workers') return Game.milkProgress*0.125*milkMult;
  44. if (kName === 'Kitten engineers') return Game.milkProgress*0.15*milkMult;
  45. if (kName === 'Kitten overseers') return Game.milkProgress*0.175*milkMult;
  46. if (kName === 'Kitten managers') return Game.milkProgress*0.2*milkMult;
  47. if (kName === 'Kitten accountants') return Game.milkProgress*0.2*milkMult;
  48. if (kName === 'Kitten specialists') return Game.milkProgress*0.2*milkMult;
  49. if (kName === 'Kitten experts') return Game.milkProgress*0.2*milkMult;
  50. if (kName === 'Kitten consultants') return Game.milkProgress*0.2*milkMult;
  51. if (kName === 'Kitten assistants to the regional manager') return Game.milkProgress*0.175*milkMult;
  52. if (kName === 'Kitten marketeers') return Game.milkProgress*0.15*milkMult;
  53. if (kName === 'Kitten analysts') return Game.milkProgress*0.125*milkMult;
  54. if (kName === 'Kitten angels') return Game.milkProgress*0.1*milkMult;
  55. return 0;
  56. },
  57. getDragonAuraName: function (aura) {
  58. if (typeof Game.dragonAuras[aura] !== 'undefined') {
  59. return Game.dragonAuras[aura].name + " (" + Game.dragonAuras[aura].desc + ")";
  60. }
  61. return 'Unknown (' + aura + ')';
  62. },
  63. beautify: function(n, floats) {
  64. return n < 1 ? String(n) : Beautify(parseFloat(n), floats);
  65. },
  66. dragonHasAura2: function () {
  67. return Game.dragonLevel >= 21;
  68. }
  69. };
  70.  
  71. var _GameStat = {
  72. halloweenSeasonUpgrades: ['Skull cookies','Ghost cookies','Bat cookies','Slime cookies','Pumpkin cookies','Eyeball cookies','Spider cookies'],
  73. valentineUpgrades: ['Pure heart biscuits','Ardent heart biscuits','Sour heart biscuits','Weeping heart biscuits','Golden heart biscuits','Eternal heart biscuits'],
  74. christmasUpgrades: ['Christmas tree biscuits','Snowflake biscuits','Snowman biscuits','Holly biscuits','Candy cane biscuits','Bell biscuits','Present biscuits'],
  75. getBuffMult: function () {
  76. var buffMult = 1;
  77. for (var buff in Game.buffs) {
  78. if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
  79. buffMult = buffMult * Game.buffs[buff].multCpS;
  80. }
  81. }
  82. return buffMult <= 0 ? 1 : buffMult;
  83. },
  84. getNormalCookiesPs: function () {
  85. return Game.cookiesPs > 0 ? Game.cookiesPs / _GameStat.getBuffMult() : 1;
  86. },
  87. getMinimalMoney: function () {
  88. return Math.floor(_GameStat.getNormalCookiesPs() * 42100 * _BotSettings.options.bankStoragePercent / 100);
  89. },
  90. getMoneyCanSpend: function () {
  91. return Game.cookies - _GameStat.getMinimalMoney();
  92. },
  93. getWrinklerCount: function () {
  94. var wrinklersCount = 0;
  95. for (var i in Game.wrinklers) {
  96. if (Game.wrinklers[i].sucked > 0) {
  97. wrinklersCount++;
  98. }
  99. }
  100. return wrinklersCount;
  101. },
  102. getUpgradeListToUnlock: function() {
  103. var result = [];
  104. for (var x in Game.UnlockAt) {
  105. if (Game.UnlockAt.hasOwnProperty(x) &&
  106. Game.Upgrades.hasOwnProperty(Game.UnlockAt[x].name) &&
  107. Game.Upgrades[Game.UnlockAt[x].name].bought === 0)
  108. {
  109. result.push(Game.UnlockAt[x]);
  110. }
  111. }
  112.  
  113. for (x in _GameStat.halloweenSeasonUpgrades) {
  114. if (_GameStat.halloweenSeasonUpgrades.hasOwnProperty(x) &&
  115. Game.Upgrades[_GameStat.halloweenSeasonUpgrades[x]].bought === 0)
  116. {
  117. result.push({cookies:'',name:_GameStat.halloweenSeasonUpgrades[x],require:'Kill wrinkler',season:'halloween'});
  118. }
  119. }
  120.  
  121. for (x in Game.easterEggs) {
  122. if (Game.easterEggs.hasOwnProperty(x) &&
  123. Game.Upgrades[Game.easterEggs[x]].bought === 0)
  124. {
  125. result.push({cookies:'',name:Game.easterEggs[x],require:'Find egg',season:'easter'});
  126. }
  127. }
  128.  
  129. var lastValentineName = '';
  130. for (x in _GameStat.valentineUpgrades) {
  131. if (_GameStat.valentineUpgrades.hasOwnProperty(x) &&
  132. Game.Upgrades[_GameStat.valentineUpgrades[x]].bought === 0)
  133. {
  134. result.push({cookies:'',name:_GameStat.valentineUpgrades[x],require:lastValentineName,season:'valentines'});
  135. lastValentineName = _GameStat.valentineUpgrades[x];
  136. }
  137. }
  138.  
  139. for (x in _GameStat.christmasUpgrades) {
  140. if (_GameStat.christmasUpgrades.hasOwnProperty(x) &&
  141. Game.Upgrades[_GameStat.christmasUpgrades[x]].bought === 0)
  142. {
  143. result.push({cookies:Game.Upgrades[_GameStat.christmasUpgrades[x]].basePrice,name:_GameStat.christmasUpgrades[x],require:'Christmas',season:'christmas'});
  144. }
  145. }
  146.  
  147. return result;
  148. }
  149. };
  150.  
  151. var _BotStat = {
  152. getHistoryList: function() {
  153. var hist = [];
  154. hist.push('2.169 - added achievements Neverclick and Hardcore');
  155. hist.push('2.156 - lumps harvesting + achievement');
  156. hist.push('2.155 - fix some bugs with new version of the Game');
  157. hist.push('2.136 - buyAll function (it is a kind of cheat)');
  158. hist.push('2.128 - santa and dragon upgrades');
  159. hist.push('2.122 - season switcher');
  160. hist.push('2.118 - show season unlocks in "Need to unlock" table');
  161. hist.push('2.114 - option to disable auto clicking');
  162. hist.push('2.113 - info table "Achievements to unlock"');
  163. hist.push('2.112 - info table "Need to unlock"');
  164. hist.push('2.111 - option to buy infernal upgrades');
  165. hist.push('2.109 - kill all wrinklers button');
  166. hist.push('2.107 - click first 15 minutes after ascend');
  167. hist.push('2.101 - remove all bufs on negative multiplier (same as reload page)');
  168. hist.push('2.100 - Info section + ascend detector');
  169. hist.push('2.099 - mouse click upgrades');
  170. hist.push('2.097 - auto bank storage');
  171. hist.push('2.096 - buy objects more than 1');
  172. hist.push('2.091 - priority table refactor');
  173. hist.push('2.090 - buy very cheap items first');
  174. hist.push('2.086 - clear log button');
  175. hist.push('2.084 - buy unknown upgrades if their price is 0.1% of cookie storage');
  176. hist.push('2.083 - mouse upgrades is processed as Upgrades');
  177. hist.push('2.082 - start from scratch');
  178. hist.push('2.079 - hide donate box');
  179. hist.push('2.078 - Kittens now is processed as Upgrades');
  180. return hist;
  181. }
  182. };
  183.  
  184. var _BotSettings = {
  185. options: {
  186. bankStoragePercent: 0,
  187. bankStorageAuto: false,
  188. buyInfernalUpgrades: false,
  189. noClicking: false,
  190. autoSeason: false,
  191. disableTicker: false
  192. },
  193. store: function(name, value) {
  194. if (typeof(Storage) !== "undefined") localStorage.setItem(name, value);
  195. },
  196. restore: function(name, asBool) {
  197. if (typeof asBool === 'undefined') asBool = false;
  198. if (typeof(Storage) !== "undefined") {
  199. if (asBool) {
  200. return (localStorage.getItem(name) === 'true' || localStorage.getItem(name) === true);
  201. } else {
  202. return localStorage.getItem(name);
  203. }
  204. }
  205. else return undefined;
  206. },
  207. restoreAll: function() {
  208. _BotSettings.options.bankStoragePercent = parseInt(_BotSettings.restore('bankStoragePercent'));
  209. if (typeof _BotSettings.options.bankStoragePercent === 'undefined' || _BotSettings.options.bankStoragePercent === null) {
  210. _BotSettings.options.bankStoragePercent = 0;
  211. }
  212. _BotSettings.options.bankStorageAuto = _BotSettings.restore('bankStorageAuto', true);
  213. if (typeof _BotSettings.options.bankStorageAuto === 'undefined' || _BotSettings.options.bankStorageAuto === null) {
  214. _BotSettings.options.bankStorageAuto = false;
  215. }
  216.  
  217. _BotSettings.options.buyInfernalUpgrades = _BotSettings.restore('buyInfernalUpgrades', true);
  218. if (typeof _BotSettings.options.buyInfernalUpgrades === 'undefined' || _BotSettings.options.buyInfernalUpgrades === null) {
  219. _BotSettings.options.buyInfernalUpgrades = false;
  220. }
  221.  
  222. _BotSettings.options.noClicking = _BotSettings.restore('noClicking', true);
  223. if (typeof _BotSettings.options.noClicking === 'undefined' || _BotSettings.options.noClicking === null) {
  224. _BotSettings.options.noClicking = false;
  225. }
  226.  
  227. _BotSettings.options.autoSeason = _BotSettings.restore('autoSeason', true);
  228. if (typeof _BotSettings.options.autoSeason === 'undefined' || _BotSettings.options.autoSeason === null) {
  229. _BotSettings.options.autoSeason = false;
  230. }
  231.  
  232. _BotSettings.options.disableTicker = _BotSettings.restore('disableTicker', true);
  233. if (typeof _BotSettings.options.disableTicker === 'undefined' || _BotSettings.options.disableTicker === null) {
  234. _BotSettings.options.disableTicker = false;
  235. }
  236. },
  237. setBankStogarePercent: function(val, needUpdate) {
  238. if (_BotSettings.options.bankStoragePercent !== val) {
  239. if (needUpdate === true) jQuery('#bankStoragePercent').val(val);
  240. if (console) console.log('bankStoragePercent =', val);
  241. _BotSettings.store('bankStoragePercent', val);
  242. _BotSettings.options.bankStoragePercent = val;
  243. jQuery('#bankStoragePercentLabel').text('Storage (' + _GameHelpers.beautify(_GameStat.getMinimalMoney()) + ') percent: ' + val + '%');
  244. _LogPage.updateLog();
  245. }
  246. },
  247. getOptionNameByButtonId: function (id) {
  248. if (id === 'bankStorageAuto') {
  249. return "Automatic set of bank storage percent";
  250. } else if (id === 'buyInfernalUpgrades') {
  251. return "Automatic buy infernal upgrades (makes granny evil)";
  252. } else if (id === 'noClicking') {
  253. return "Restrict auto clicking";
  254. } else if (id === 'autoSeason') {
  255. return "Auto season swithcer";
  256. } else if (id === 'disableTicker') {
  257. return "News disabled";
  258. }
  259. return "";
  260. },
  261. getOptionTitle: function (optionName) {
  262. return _BotSettings.getOptionNameByButtonId(optionName) + ": " +
  263. (_BotSettings.options[optionName] ? 'TRUE' : 'FALSE');
  264. }
  265. };
  266.  
  267. var _BotUI = {
  268. $caption: undefined,
  269. $logButton: undefined,
  270. $getCaption: function() {
  271. if (typeof _BotUI.$caption === 'undefined') {
  272. _BotUI.$caption = jQuery('#versionNumber');
  273. }
  274. return _BotUI.$caption;
  275. },
  276. setCaption: function(txt) {
  277. if (_BotUI.$getCaption().text() !== txt) _BotUI.$getCaption().text(txt);
  278. },
  279. setTitle: function(txt) {
  280. var newTitle = (_LogPage.newLogs > 0 ? '(' + _LogPage.newLogs + ') ' : '') + txt;
  281. if (document.title !== newTitle) {
  282. oldTitle = txt;
  283. document.title = newTitle;
  284. }
  285. },
  286. setTitleWithPercent: function(have, need, txt) {
  287. var percent = Math.ceil(have / (need !== 0 ? need : 1) * 100);
  288. _BotUI.setTitle(String(percent) + "% - " + txt);
  289. },
  290. triggerOptionValue: function(optionName, $button) {
  291. _BotSettings.options[optionName] = !_BotSettings.options[optionName];
  292. _BotSettings.store(optionName, _BotSettings.options[optionName]);
  293. var newButtonTitle = _BotSettings.getOptionTitle(optionName);
  294. _LogPage.addLog(newButtonTitle, true);
  295. $button.text(newButtonTitle);
  296. },
  297. processUiButtonClick: function ($button) {
  298. var id = $button.attr('data-id');
  299. if (id === 'bankStorageAuto') {
  300. _BotUI.triggerOptionValue('bankStorageAuto', $button);
  301. _BotLogic.bankAutoFunction();
  302. } else if (id === 'killWrinklers') {
  303. _BotLogic.killAllWrinklers(true);
  304. } else if (id === 'buyEverything') {
  305. _BotLogic.buyEverything();
  306. } else if (id === 'buyInfernalUpgrades') {
  307. _BotUI.triggerOptionValue('buyInfernalUpgrades', $button);
  308. } else if (id === 'noClicking') {
  309. _BotUI.triggerOptionValue('noClicking', $button);
  310. } else if (id === 'autoSeason') {
  311. _BotUI.triggerOptionValue('autoSeason', $button);
  312. } else if (id === 'disableTicker') {
  313. _BotUI.triggerOptionValue('disableTicker', $button);
  314. } else if (id === 'clearLog') {
  315. _LogPage.logLinesArray = [];
  316. _LogPage.newLogs = 0;
  317. }
  318. _LogPage.updateLog();
  319. },
  320. initLogButton: function() {
  321. _BotUI.$logButton = jQuery('#logButton');
  322.  
  323. _BotUI.$logButton.text('Log').on("click", function() {
  324. _LogPage.newLogs = 0;
  325. _BotUI.$logButton.text('Log');
  326. });
  327.  
  328. Game.CCT = {}; // Coockie clicker tools
  329. Game.CCT.onsliderchange = function(el) {
  330. var val = $(el).val();
  331. _BotSettings.setBankStogarePercent(val);
  332. };
  333. Game.CCT.getPriorityListObj = function() {
  334. return _Priority.aList;
  335. };
  336. Game.CCT.onbuttonclick = function(el,e) {
  337. e.preventDefault();
  338. var $button = jQuery(el);
  339. _BotUI.processUiButtonClick($button);
  340. };
  341. },
  342. initBot: function () {
  343. jQuery('#versionNumber').on("click", function() {
  344. if (!_BotLogic.started)
  345. _BotLogic.start();
  346. else
  347. _BotLogic.stop();
  348. });
  349. jQuery('#donateBox').hide();
  350. }
  351. };
  352.  
  353. var _Priority = {
  354. aList: {},
  355. addPriorityForUpgrades: function () {
  356. var moneyCanSpend = _GameStat.getMoneyCanSpend();
  357. var buffMult = _GameStat.getBuffMult();
  358.  
  359. for (var g in Game.UpgradesById) {
  360. if (Game.UpgradesById[g].bought === 0 && parseInt(Game.UpgradesById[g].unlocked) === 1) {
  361. var isMultiplier = Game.UpgradesById[g].desc.indexOf('production multiplier') >= 0;
  362. var isDouble = Game.UpgradesById[g].desc.indexOf('<b>twice</b>') >= 0;
  363. var isDoubleGrandma = Game.UpgradesById[g].desc.indexOf('Grandmas are <b>twice</b>') >= 0;
  364. var isKitten = Game.UpgradesById[g].name.indexOf('Kitten ') >= 0;
  365. var isDoubleCursor = Game.UpgradesById[g].desc.indexOf('The mouse and cursors are <b>twice</b>') >= 0;
  366. var isClickIncrease = Game.UpgradesById[g].desc.indexOf('Clicking gains <b>+1%') >= 0;
  367. var isSpecialTech = Game.UpgradesById[g].pool === 'tech' && typeof Game.UpgradesById[g].clickFunction !== 'undefined';
  368. if (isSpecialTech && Game.UpgradesById[g].clickFunction !== 'undefined' && _BotSettings.options.buyInfernalUpgrades) {
  369. delete (Game.UpgradesById[g].clickFunction);
  370. }
  371. var increasedMoney = 0;
  372. if (isClickIncrease) {
  373. if (!_GameHelpers.isNeverclick) {
  374. increasedMoney = Game.cookiesPs * 0.01;
  375. }
  376. } else if (isDoubleCursor) {
  377. increasedMoney = Game.Objects['Cursor'].storedTotalCps * Game.globalCpsMult / buffMult;
  378. if (isClickingNow) increasedMoney += Game.computedMouseCps * 1000 / tAutoClickInterval;
  379. } else if (isKitten) {
  380. var kittenPercent = _GameHelpers.getKittenPercentByUpgradeName(Game.UpgradesById[g].name);
  381. increasedMoney = _GameStat.getNormalCookiesPs() * kittenPercent;
  382. } else if (isDoubleGrandma) {
  383. increasedMoney = Game.Objects['Grandma'].storedTotalCps * Game.globalCpsMult / buffMult;
  384. } else if (isMultiplier) {
  385. increasedMoney = _GameStat.getNormalCookiesPs() * Game.UpgradesById[g].power / 100;
  386. } else if (isDouble) {
  387. increasedMoney = Game.UpgradesById[g].buildingTie.storedTotalCps * Game.globalCpsMult / buffMult;
  388. }
  389. var interest = increasedMoney > 0 ? Game.UpgradesById[g].getPrice() / increasedMoney : '-';
  390. if (interest !== '-') {
  391. if (typeof _Priority.aList[Math.floor(interest)] === 'undefined') {
  392. var pp = moneyCanSpend / Game.UpgradesById[g].getPrice(); // percent of cheapness
  393. if (pp > 50) interest /= pp * 50;
  394. _Priority.aList[Math.floor(interest)] = {
  395. name: Game.UpgradesById[g].name,
  396. price: Game.UpgradesById[g].getPrice(),
  397. cps: 1,
  398. type: 'upgrade',
  399. id: g,
  400. income: increasedMoney
  401. };
  402. }
  403. } else if (Game.UpgradesById[g].type === 'upgrade' &&
  404. Game.UpgradesById[g].getPrice() < moneyCanSpend &&
  405. Game.UpgradesById[g].pool !== 'toggle' && (!isSpecialTech || _BotSettings.options.buyInfernalUpgrades))
  406. {
  407. interest = Game.UpgradesById[g].getPrice() / moneyCanSpend * 1000;
  408. if (typeof _Priority.aList[Math.floor(interest)] === 'undefined') {
  409. pp = moneyCanSpend / Game.UpgradesById[g].getPrice(); // percent of cheapness
  410. if (pp > 50) interest /= pp * 50;
  411. _Priority.aList[Math.floor(interest)] = {
  412. name: Game.UpgradesById[g].name,
  413. price: Game.UpgradesById[g].getPrice(),
  414. cps: 1,
  415. type: 'upgrade',
  416. id: g,
  417. income: 0
  418. };
  419. }
  420. }
  421. }
  422. }
  423. },
  424. addPriorityForObjects: function () {
  425. var moneyCanSpend = _GameStat.getMoneyCanSpend();
  426. var buffMult = _GameStat.getBuffMult();
  427.  
  428. for (var i in Game.ObjectsById) {
  429. if (typeof i !== 'undefined' && i !== 'undefined' && Game.ObjectsById.hasOwnProperty(i)) {
  430. if (Game.ObjectsById[i].locked === 0) {
  431. var objectCps = Math.max(Game.ObjectsById[i].storedTotalCps, Game.ObjectsById[i].storedCps);
  432. var objectAmount = Math.max(Game.ObjectsById[i].amount, 1);
  433. var cps = (objectCps / objectAmount) * Game.globalCpsMult / buffMult;
  434. var interest = Game.ObjectsById[i].price / cps;
  435. var pp2 = moneyCanSpend / Game.ObjectsById[i].price; // percent of cheapness
  436. if (pp2 > 50) interest /= pp2 * 50;
  437. if (isNaN(Math.floor(interest)) && Game.ObjectsById[i].price < moneyCanSpend) interest = 0;
  438. _Priority.aList[Math.floor(interest)] = {
  439. name: Game.ObjectsById[i].name,
  440. price: Game.ObjectsById[i].price,
  441. cps: cps,
  442. type: 'buy',
  443. id: i,
  444. income: cps
  445. };
  446. }
  447. }
  448. }
  449. },
  450. createPriorityList: function() {
  451. if (_GameHelpers.isAscend()) return;
  452.  
  453. _Priority.aList = {};
  454.  
  455. // top priority
  456. var topPriorityList = ['A festive hat','A crumbly egg','Heavenly chip secret','Heavenly cookie stand','Heavenly bakery','Heavenly confectionery','Heavenly key'];
  457. for (var tt in topPriorityList) {
  458. var tp = Game.Upgrades[topPriorityList[tt]];
  459. if (typeof tp !== 'undefined' && tp.bought === 0 && parseInt(tp.unlocked) === 1) {
  460. tp.buy();
  461. break;
  462. }
  463. }
  464.  
  465. if (!_GameHelpers.isHardcore()) {
  466. _Priority.addPriorityForUpgrades();
  467. }
  468.  
  469. _Priority.addPriorityForObjects();
  470. }
  471. };
  472.  
  473. var _LogPage = {
  474. version: (typeof GM_info == 'function' ? GM_info().script.version :
  475. (typeof GM_info == 'object' ? GM_info.script.version : '?')),
  476. logTitle: '<div class="section">Cookie clicker tools is here!</div>',
  477. logLinesArray: [],
  478. newLogs: 0,
  479. clearLogButton: '<button data-id="clearLog" onclick="Game.CCT.onbuttonclick(this,event)">Clear Log</button>',
  480. killWrinklersButton: '<button data-id="killWrinklers" onclick="Game.CCT.onbuttonclick(this,event)">Kill wrinklers</button>',
  481. buyEverythingButton: '<button data-id="buyEverything" onclick="Game.CCT.onbuttonclick(this,event)">Buy everything</button>',
  482. priorityTableStyles: '<style type="text/css">.prioritytable{width:100%;}.prioritytable td,.prioritytable th{padding:3px;}</style>',
  483. priorityTableHeader: '<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>',
  484. needbuyTableHeader: '<table class="prioritytable"><tr style="border-bottom:1px solid;text-align:left;font-weight:bold;"><th>Name</th><th>Price</th><th>Prerequisite</th><th>Season</th></tr>',
  485. needAchieveTableHeader: '<table class="prioritytable"><tr style="border-bottom:1px solid;text-align:left;font-weight:bold;"><th>Name</th><th>Description</th></tr>',
  486. tableFooter: '</table>',
  487. lastLogUpdatedTime: new Date(),
  488. getTableRow: function (cols) {
  489. var result = '<tr>';
  490. for (var colId in cols) {
  491. if (cols.hasOwnProperty(colId)) {
  492. result += '<td>' + cols[colId] + '</td>';
  493. }
  494. }
  495. return result + '</tr>'
  496. },
  497. getLogSectionTitle: function (text) {
  498. return '<div class="title">' + text + '</div>';
  499. },
  500. getLogSection: function (sectionTitle, items) {
  501. return '<div class="subsection">' + _LogPage.getLogSectionTitle(sectionTitle) +
  502. '<div class="listing">' + items.join('</div><div class="listing">') + '</div>' +
  503. '</div>';
  504. },
  505. getLogPriorityTable: function() {
  506. var moneyCanSpend = _GameStat.getMoneyCanSpend();
  507. var t = _LogPage.priorityTableHeader;
  508. for (var i in _Priority.aList) {
  509. if (_Priority.aList.hasOwnProperty(i)) {
  510. var o = _Priority.aList[i];
  511. var pp = Math.floor(moneyCanSpend / o.price * 100);
  512. t += '<tr><td>' + o.type + '</td><td>' + o.name + '</td><td>' + _GameHelpers.beautify(o.price) + '</td><td>' + i + '</td><td>' + _GameHelpers.beautify(o.income) + '</td><td>' + pp + '</td></tr>';
  513. }
  514. }
  515. t += '</table>';
  516. var priorityListCaption = 'Priority ' + _LogPage.clearLogButton + ' ' + _LogPage.killWrinklersButton + ' ' + _LogPage.buyEverythingButton;
  517. return _LogPage.priorityTableStyles + '<div class="subsection">' + _LogPage.getLogSectionTitle(priorityListCaption) + '<div class="listing">' + t + '</div></div>';
  518. },
  519. getLogNeedBuyTable: function() {
  520. var objList = _GameStat.getUpgradeListToUnlock();
  521. if (objList && objList.length > 0) {
  522. var t = _LogPage.needbuyTableHeader;
  523. for (var i in objList) {
  524. if (objList.hasOwnProperty(i)) {
  525. var o = objList[i];
  526. t += _LogPage.getTableRow([
  527. o.name,
  528. _GameHelpers.beautify(o.cookies),
  529. typeof o.require !== 'undefined' ? o.require : '',
  530. typeof o.season !== 'undefined' ? o.season : ''
  531. ]);
  532. }
  533. }
  534. t += _LogPage.tableFooter;
  535. return _LogPage.priorityTableStyles + '<div class="subsection">' + _LogPage.getLogSectionTitle('Need to unlock') + '<div class="listing">' + t + '</div></div>';
  536. } else {
  537. return '';
  538. }
  539. },
  540. getLogNeedAchieveTable: function() {
  541. var ach = [];
  542. for (var i in Game.Achievements) {
  543. if(Game.Achievements[i].won === 0 && Game.Achievements[i].pool !== 'dungeon') {
  544. ach.push(Game.Achievements[i]);
  545. }
  546. }
  547. if (ach.length > 0) {
  548. var t = _LogPage.needAchieveTableHeader;
  549. for (i in ach) {
  550. var o = ach[i];
  551. t += _LogPage.getTableRow([
  552. o.name,
  553. o.desc
  554. ]);
  555. }
  556. t += _LogPage.tableFooter;
  557. return _LogPage.priorityTableStyles + '<div class="subsection">' + _LogPage.getLogSectionTitle('Achievements to unlock') + '<div class="listing">' + t + '</div></div>';
  558. } else {
  559. return '';
  560. }
  561. },
  562. getOptionsSectionList: function() {
  563. var content = [];
  564. content.push('<label for="bankStoragePercent" id="bankStoragePercentLabel">Storage (' + _GameHelpers.beautify(_GameStat.getMinimalMoney()) + ') percent: ' + _BotSettings.options.bankStoragePercent + '%</label> <input name="bankStoragePercent" id="bankStoragePercent" type="range" min="0" max="100" value="' + _BotSettings.options.bankStoragePercent + '" onchange="Game.CCT.onsliderchange(this)" />');
  565. content.push('<button data-id="bankStorageAuto" onclick="Game.CCT.onbuttonclick(this,event)">' + _BotSettings.getOptionTitle('bankStorageAuto') + '</button>');
  566. content.push('<button data-id="buyInfernalUpgrades" onclick="Game.CCT.onbuttonclick(this,event)">' + _BotSettings.getOptionTitle('buyInfernalUpgrades') + '</button>');
  567. content.push('<button data-id="noClicking" onclick="Game.CCT.onbuttonclick(this,event)">' + _BotSettings.getOptionTitle('noClicking') + '</button>');
  568. content.push('<button data-id="autoSeason" onclick="Game.CCT.onbuttonclick(this,event)">' + _BotSettings.getOptionTitle('autoSeason') + '</button>');
  569. content.push('<button data-id="disableTicker" onclick="Game.CCT.onbuttonclick(this,event)">' + _BotSettings.getOptionTitle('disableTicker') + '</button>');
  570. content.push( _LogPage.clearLogButton);
  571. return content;
  572. },
  573. getInfoSectionList: function() {
  574. var content = [];
  575.  
  576. var wrinklersTotal = 0;
  577. for (var i in Game.wrinklers) {
  578. wrinklersTotal += Game.wrinklers[i].sucked;
  579. }
  580.  
  581. var chipsOwned = Math.floor(Game.HowMuchPrestige(Game.cookiesReset));
  582. var ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
  583. var ascendWillGet = ascendNowToOwn - chipsOwned;
  584. var cookiesToDoubleInitial = Game.HowManyCookiesReset(chipsOwned * 2) - (Game.cookiesEarned + Game.cookiesReset);
  585. var normalCookiePs = _GameStat.getNormalCookiesPs();
  586. var timeToReachDouble = Math.floor(cookiesToDoubleInitial / normalCookiePs);
  587.  
  588. content.push('Now clicking: ' + (isClickingNow ? "YES" : "NO"));
  589. content.push('Per click: ' + _GameHelpers.beautify(Game.computedMouseCps));
  590. content.push('Cookies to double prestige: ' + (cookiesToDoubleInitial >= 0 ? _GameHelpers.beautify(cookiesToDoubleInitial) : 'No info'));
  591. content.push('Time to double prestige: ' + Game.sayTime(timeToReachDouble * Game.fps, 2));
  592. content.push('Heavenly chips in storage: ' + Game.heavenlyChips);
  593. content.push('You will get prestige by ascending: ' + ascendWillGet);
  594. content.push('Heavenly chips after ascend: ' + (Game.heavenlyChips + ascendWillGet));
  595. content.push('Buff mult: ' + _GameStat.getBuffMult());
  596. content.push('Normal CpS: ' + _GameHelpers.beautify(normalCookiePs));
  597. content.push('Money bank: ' + _GameHelpers.beautify(_GameStat.getMinimalMoney()));
  598. content.push('Money can spend: ' + _GameHelpers.beautify(_GameStat.getMoneyCanSpend()));
  599. content.push('Wrinklers: ' + _GameStat.getWrinklerCount());
  600. content.push('Wrinklers sucked: ' + _GameHelpers.beautify(wrinklersTotal));
  601. if (Game.dragonLevel<Game.dragonLevels.length-1) {
  602. content.push('Next Dragon upgrade: ' + Game.dragonLevels[Game.dragonLevel].costStr());
  603. }
  604. if (_GameHelpers.hasDragon() && Game.dragonAura >= 0 && typeof Game.dragonAuras[Game.dragonAura] !== 'undefined') {
  605. content.push("Aura: " + _GameHelpers.getDragonAuraName(Game.dragonAura));
  606. if (_GameHelpers.dragonHasAura2()) {
  607. content.push("Aura 2: " + _GameHelpers.getDragonAuraName(Game.dragonAura2));
  608. }
  609. }
  610. return content;
  611. },
  612. updateLog: function () {
  613. if (_GameHelpers.isAscend()) return;
  614.  
  615. var curTime = new Date();
  616. var timeInterval = curTime - _LogPage.lastLogUpdatedTime;
  617. if (timeInterval <= 500) return;
  618. _LogPage.lastLogUpdatedTime = curTime;
  619.  
  620. Game.updateLog = _LogPage.logTitle +
  621. _LogPage.getLogPriorityTable() +
  622. _LogPage.getLogSection('Info', _LogPage.getInfoSectionList()) +
  623. _LogPage.getLogSection('Log', _LogPage.logLinesArray) +
  624. _LogPage.getLogSection('Options', _LogPage.getOptionsSectionList()) +
  625. _LogPage.getLogNeedBuyTable() +
  626. _LogPage.getLogNeedAchieveTable() +
  627. _LogPage.getLogSection('History', _BotStat.getHistoryList());
  628. var newButtonText = _LogPage.newLogs > 0 ? 'Log (' + _LogPage.newLogs + ')' : 'Log';
  629. if (_BotUI.$logButton.text() !== newButtonText) _BotUI.$logButton.text(newButtonText);
  630. _BotUI.setTitle(oldTitle);
  631. },
  632. addLog: function(text, notCritical) {
  633. var t = new Date();
  634. _LogPage.logLinesArray.push(t.toUTCString() + ': ' + text);
  635. if (notCritical !== true) _LogPage.newLogs++;
  636. _LogPage.updateLog();
  637. },
  638. init: function () {
  639. _LogPage.logTitle = '<div class="section">Cookie clicker tools ' + _LogPage.version + ' is here!</div>';
  640. }
  641. };
  642.  
  643. var _BotLogic = {
  644. started: false,
  645. killAllWrinklers: function (immediately) {
  646. if (typeof immediately === 'undefined') immediately = false;
  647. var wrinklersCount = _GameStat.getWrinklerCount();
  648. if (wrinklersCount >= 10 || immediately === true) {
  649. var wrinklesIncome = 0;
  650. for (var i in Game.wrinklers) {
  651. wrinklesIncome += Game.wrinklers[i].sucked;
  652. Game.wrinklers[i].hp = 0; // kill ALL
  653. }
  654. if (wrinklesIncome > 0) {
  655. _LogPage.addLog('Killed all Wrinkles for ' + _GameHelpers.beautify(wrinklesIncome) + ' of count ' + wrinklersCount + '.', true);
  656. }
  657. }
  658. },
  659. buyEverything: function () {
  660. if (!_GameHelpers.isHardcore()) {
  661. for (var x in Game.UpgradesById) {
  662. if (Game.UpgradesById.hasOwnProperty(x)) {
  663. if (parseInt(Game.UpgradesById[x].unlocked) === 1
  664. && Game.UpgradesById[x].bought === 0 && Game.UpgradesById[x].canBuy()) {
  665. var pool = Game.UpgradesById[x].pool;
  666. if (pool !== "prestige" &&
  667. pool !== 'debug' &&
  668. pool !== 'toggle' &&
  669. pool !== 'tech' &&
  670. pool !== 'shadow' &&
  671. pool !== 'unused' &&
  672. pool !== 'dungeon') {
  673. Game.UpgradesById[x].buy();
  674. _LogPage.addLog('Buy upgrade ' + Game.UpgradesById[x].name + ' for ' + _GameHelpers.beautify(Game.UpgradesById[x].getPrice()));
  675. }
  676. }
  677. }
  678. }
  679. }
  680. for (x in Game.ObjectsById) {
  681. if (Game.ObjectsById.hasOwnProperty(x)) {
  682. var cnt = 0, sum = 0;
  683. while (Game.cookies >= Game.ObjectsById[x].getPrice()) {
  684. sum += Game.ObjectsById[x].getPrice();
  685. Game.ObjectsById[x].buy(1);
  686. cnt++;
  687. }
  688. if (cnt > 0) _LogPage.addLog('Buy ' + cnt + ' object ' + Game.ObjectsById[x].name + ' for ' + _GameHelpers.beautify(sum));
  689. }
  690. }
  691. },
  692. buyLump: function () {
  693. if (!Game.canLumps()) return;
  694. var needAchievement = Game.Achievements['Hand-picked'] &&
  695. parseInt(Game.Achievements['Hand-picked'].won) === 0;
  696. var age = Date.now() - Game.lumpT;
  697.  
  698. if (age > Game.lumpMatureAge && needAchievement) {
  699. _LogPage.addLog('Trying to get lump achievement, collecting Mature lump');
  700. if (Game.clickLump) Game.clickLump();
  701. } else if (age > Game.lumpRipeAge) {
  702. _LogPage.addLog('Collecting Ripe lump');
  703. if (Game.clickLump) Game.clickLump();
  704. } else if (age > Game.lumpOverripeAge) {
  705. _LogPage.addLog('Collecting Overripe lump');
  706. if (Game.clickLump) Game.clickLump();
  707. }
  708. },
  709. bankAutoFunction: function () {
  710. if (_BotSettings.options.bankStorageAuto && !_GameHelpers.isAscend()) {
  711. for (var idx in _Priority.aList) {
  712. if (_Priority.aList.hasOwnProperty(idx)) {
  713. var bankStorageNew = Math.floor(idx / 50000);
  714. if (bankStorageNew > 100) bankStorageNew = 100;
  715. if (!isNaN(bankStorageNew)) _BotSettings.setBankStogarePercent(bankStorageNew, true);
  716. else if (console) console.log('bankStorageNew error:', idx);
  717. break;
  718. }
  719. }
  720. }
  721. },
  722. makeABuy: function() {
  723. if (_GameHelpers.isAscend()) return;
  724.  
  725. _BotLogic.killAllWrinklers();
  726.  
  727. var moneyCanSpend = _GameStat.getMoneyCanSpend();
  728.  
  729. if (moneyCanSpend < 0) {
  730. var minimalMoney = _GameStat.getMinimalMoney();
  731. _BotUI.setCaption('Collecting minimum ' + _GameHelpers.beautify(minimalMoney));
  732. _BotUI.setTitleWithPercent(Game.cookies, minimalMoney, 'minimum');
  733. return;
  734. }
  735.  
  736. for (var idx in _Priority.aList) {
  737. if (_Priority.aList.hasOwnProperty(idx)) {
  738. var needToBuy = _Priority.aList[idx];
  739. if (needToBuy.type === 'upgrade') {
  740. _BotUI.setCaption('Upgrading ' + needToBuy.name + ' for ' + _GameHelpers.beautify(needToBuy.price));
  741. if (needToBuy.price < moneyCanSpend) {
  742. if (Game.UpgradesById[needToBuy.id].canBuy()) {
  743. Game.UpgradesById[needToBuy.id].buy();
  744. _LogPage.addLog('Buy upgrade ' + Game.UpgradesById[needToBuy.id].name + ' for ' + _GameHelpers.beautify(needToBuy.price));
  745. _Priority.createPriorityList();
  746. }
  747. } else {
  748. _BotUI.setTitleWithPercent(moneyCanSpend, needToBuy.price, Game.UpgradesById[needToBuy.id].name);
  749. }
  750. } else {
  751. var objPrice = Game.ObjectsById[needToBuy.id].price;
  752. _BotUI.setCaption('Collecting ' + _GameHelpers.beautify(objPrice) + ' for ' + needToBuy.name);
  753. if (objPrice < moneyCanSpend) {
  754. var amount = 1;
  755. var objPrice100 = Game.ObjectsById[needToBuy.id].getSumPrice(100);
  756. var objPrice10 = Game.ObjectsById[needToBuy.id].getSumPrice(10);
  757. if (objPrice100 < moneyCanSpend) {
  758. Game.ObjectsById[needToBuy.id].buy(100);
  759. amount = 100;
  760. objPrice = objPrice100;
  761. } else if (objPrice10 < moneyCanSpend) {
  762. Game.ObjectsById[needToBuy.id].buy(10);
  763. amount = 10;
  764. objPrice = objPrice10;
  765. } else {
  766. Game.ObjectsById[needToBuy.id].buy(1);
  767. }
  768. _LogPage.addLog('Buy ' + amount + ' object ' + Game.ObjectsById[needToBuy.id].name + ' for ' + _GameHelpers.beautify(objPrice));
  769. _Priority.createPriorityList();
  770. } else {
  771. _BotUI.setTitleWithPercent(moneyCanSpend, needToBuy.price, Game.ObjectsById[needToBuy.id].name);
  772. }
  773. }
  774. break;
  775. }
  776. }
  777.  
  778. _BotLogic.buyLump();
  779. },
  780. start: function () {
  781. tAutoBuy = setInterval(_BotLogic.makeABuy, 500);
  782. tSeasonSwitcher = setInterval(_BotLogic.seasonSwitcher, 3000);
  783. tDragon = setInterval(_BotLogic.dragonSwitcher, 10000);
  784.  
  785. _BotLogic.started = true;
  786. _BotUI.setCaption('Started');
  787. _LogPage.addLog('Autobuy start!', true);
  788. },
  789. stop: function () {
  790. clearInterval(tAutoBuy);
  791. clearInterval(tSeasonSwitcher);
  792. clearInterval(tDragon);
  793.  
  794. _BotLogic.started = false;
  795. _BotUI.setCaption('Collecting gold...');
  796. _LogPage.addLog('Autobuy stop.', true);
  797. },
  798. dragonSwitcher: function () {
  799. if (_GameHelpers.isAscend()) return;
  800.  
  801. if (_GameHelpers.hasDragon() && Game.dragonLevel<Game.dragonLevels.length-1 && Game.dragonLevels[Game.dragonLevel].cost()) {
  802. _LogPage.addLog("Upgrading dragon Level " + (Game.dragonLevel+1) + " of " + Game.dragonLevels.length);
  803. Game.UpgradeDragon();
  804. Game.specialTab = 'Hello';
  805. Game.ToggleSpecialMenu(0);
  806. }
  807.  
  808. if (Game.dragonLevel >= 12 && parseInt(Game.dragonAura) !== 9) {
  809. Game.dragonAura = 9; //"Arcane Aura"
  810. Game.recalculateGains = 1;
  811. _LogPage.addLog("Switching dragon Aura to " + _GameHelpers.getDragonAuraName(Game.dragonAura));
  812. } else if (_GameHelpers.dragonHasAura2() && parseInt(Game.dragonAura2) !== 15) {
  813. Game.dragonAura2 = 15; //"Radiant Appetite"
  814. Game.recalculateGains = 1;
  815. _LogPage.addLog("Switching dragon Aura2 to " + _GameHelpers.getDragonAuraName(Game.dragonAura2));
  816. } else if (Game.dragonLevel >= 4 && Game.dragonLevel < 12 && parseInt(Game.dragonAura) !== (Game.dragonLevel - 3)) {
  817. Game.dragonAura = Game.dragonLevel - 3;
  818. Game.recalculateGains = 1;
  819. _LogPage.addLog("Switching dragon Aura to " + _GameHelpers.getDragonAuraName(Game.dragonAura));
  820. }
  821. },
  822. seasonSwitcher: function() {
  823. if (!_BotSettings.options.autoSeason) return;
  824. if (_GameHelpers.isAscend()) return;
  825.  
  826. if (_GameStat.getWrinklerCount() >= 8) {
  827. var halloweenSeason = ['Skull cookies','Ghost cookies','Bat cookies','Slime cookies','Pumpkin cookies','Eyeball cookies','Spider cookies'];
  828. for (var x in halloweenSeason) {
  829. if (halloweenSeason.hasOwnProperty(x) && Game.Upgrades[halloweenSeason[x]].bought === 0) {
  830. if (Game.season !== 'halloween') {
  831. Game.Upgrades['Ghostly biscuit'].buy();
  832. _BotLogic.killAllWrinklers(true);
  833. return;
  834. }
  835. }
  836. }
  837. }
  838.  
  839. if (!Game.Has('Santa\'s dominion')) {
  840. if (Game.season !== 'christmas') {
  841. Game.Upgrades['Festive biscuit'].buy();
  842. } else {
  843. if (Game.Has('A festive hat')) {
  844. for (var i = 0; i < (14 - Game.santaLevel); i++) Game.UpgradeSanta();
  845. Game.specialTab = 'Hello';
  846. Game.ToggleSpecialMenu(0);
  847. }
  848. }
  849. return;
  850. }
  851.  
  852. var valentines = ['Pure heart biscuits','Ardent heart biscuits','Sour heart biscuits','Weeping heart biscuits','Golden heart biscuits','Eternal heart biscuits'];
  853. for (x in valentines) {
  854. if (valentines.hasOwnProperty(x) && Game.Upgrades[valentines[x]].bought === 0) {
  855. if (Game.season !== 'valentines') {
  856. Game.Upgrades['Lovesick biscuit'].buy();
  857. }
  858. return;
  859. }
  860. }
  861.  
  862. for (x in Game.easterEggs) {
  863. if (Game.easterEggs.hasOwnProperty(x) && Game.Upgrades[Game.easterEggs[x]].bought === 0) {
  864. if (Game.season !== 'easter') {
  865. Game.Upgrades['Bunny biscuit'].buy();
  866. }
  867. return;
  868. }
  869. }
  870.  
  871. if (Game.season !== 'christmas') {
  872. Game.Upgrades['Festive biscuit'].buy();
  873. }
  874. },
  875. removeNegativeBuff: function () {
  876. if (_GameStat.getBuffMult() < 1) {
  877. var hasBuffsToKill = false;
  878. for (var buff in Game.buffs) {
  879. if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
  880. Game.buffs[buff].time = 0; // remove all buffs, not only negative (not cheating)
  881. hasBuffsToKill = true;
  882. }
  883. }
  884. if (hasBuffsToKill) _LogPage.addLog('Remove all buffs because of negative multiplier', true);
  885. }
  886. },
  887. updatePriorityAndLog: function () {
  888. _Priority.createPriorityList();
  889. _LogPage.updateLog();
  890. },
  891. ascendDetector: function () {
  892. if (_GameHelpers.isAscend()) {
  893. _BotUI.setCaption("Select wisely");
  894. _BotSettings.setBankStogarePercent(0, true);
  895. } else {
  896. if (_GameHelpers.isNeverclick()) {
  897. if (Game.cookiesEarned < 15) {
  898. var s = Math.max(Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time, 0);
  899. var s1 = Math.max(Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time, 0);
  900. if (s > 0) {
  901. _BotUI.setCaption("Waiting golden cookies for " + s + " time")
  902. } else if (s1 > 0) {
  903. _BotUI.setCaption("Waiting golden cookies for more " + s1 + " time")
  904. }
  905. } else if (Game.Objects.Cursor.amount === 0) {
  906. Game.Objects.Cursor.buy();
  907. }
  908. }
  909. }
  910. },
  911. popGolden: function () {
  912. var golden = Game.shimmers;
  913. if (golden && golden.length > 0) {
  914. for (var i in golden) {
  915. if (golden.hasOwnProperty(i)) {
  916. golden[i].pop();
  917. }
  918. }
  919. }
  920. },
  921. doAutoClick: function () {
  922. if (_BotSettings.options.noClicking) return;
  923. var date=new Date();
  924. date.setTime(Date.now()-Game.startDate);
  925. var seconds = date.getTime() / 1000;
  926. var buffMult = _GameStat.getBuffMult();
  927. var buffClicker = typeof Game.hasBuff !== 'undefined' && (
  928. Game.hasBuff('Click frenzy') ||
  929. Game.hasBuff('Cursed finger') ||
  930. Game.hasBuff('Elder frenzy') ||
  931. Game.hasBuff('Dragon Harvest') ||
  932. Game.hasBuff('Dragonflight')
  933. );
  934. if (buffMult >= 15 ||
  935. Game.cookiesPs < 1000000 ||
  936. buffClicker ||
  937. seconds < 1000)
  938. {
  939. var $bigCookie = jQuery('#bigCookie');
  940. Game.mouseX = $bigCookie.width() / 2 + $bigCookie.offset().left;
  941. Game.mouseY = $bigCookie.height() / 2 + $bigCookie.offset().top;
  942. if (typeof Game.ClickCookie === 'function') Game.ClickCookie();
  943. isClickingNow = true;
  944. } else {
  945. isClickingNow = false;
  946. }
  947. }
  948. };
  949.  
  950. setTimeout(function() {
  951. _BotSettings.restoreAll();
  952.  
  953. _LogPage.init();
  954. _BotUI.initBot();
  955. _BotUI.initLogButton();
  956.  
  957. tPriority = setInterval(_BotLogic.updatePriorityAndLog, 1000);
  958. tReloadPageOnWrongBuff = setInterval(_BotLogic.removeNegativeBuff, 1000);
  959. tAscendDetector = setInterval(_BotLogic.ascendDetector, 1000);
  960. tPopGolden = setInterval(_BotLogic.popGolden, 500);
  961. tBankAuto = setInterval(_BotLogic.bankAutoFunction, 600001); // 10 minutes
  962. tClickFrenzy = setInterval(_BotLogic.doAutoClick, tAutoClickInterval);
  963.  
  964. _BotUI.setCaption('Collecting gold...');
  965.  
  966. _BotLogic.updatePriorityAndLog();
  967. _BotLogic.bankAutoFunction();
  968. }, 5000);
  969. })();