Cookie clicker tools

Cookie clicker tools (visual)

目前為 2017-03-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Cookie clicker tools
  3. // @namespace orteil.dashnet.org
  4. // @version 2.102
  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 log = [], logTitle = '<div class="section">Cookie clicker tools 2.102 is here!</div>', newLogs = 0;
  14.  
  15. var started = false, t2, t3, tClick, tClickFrenzy, oldTitle = '', tLog,
  16. tPriority, tBankAuto, tAscendDetector, isClickingNow = false, tReloadPageOnWrongBuff;
  17.  
  18. var _history = function() {
  19. var hist = [];
  20. hist.push('2.101 - remove all bufs on negative multiplier (same as reload page)');
  21. hist.push('2.100 - Info section + ascend detector');
  22. hist.push('2.099 - mouse click upgrades');
  23. hist.push('2.097 - auto bank storage');
  24. hist.push('2.096 - buy objects more than 1');
  25. hist.push('2.095 - objects CpS fix (buffs)');
  26. hist.push('2.094 - objects CpS fix (buffs)');
  27. hist.push('2.093 - objects CpS fix');
  28. hist.push('2.092 - priority table fix');
  29. hist.push('2.091 - priority table refactor');
  30. hist.push('2.090 - buy very cheap items first');
  31. hist.push('2.089 - fix pool toggle buy');
  32. hist.push('2.087 - fix buy unknown upgrades');
  33. hist.push('2.086 - clear log button');
  34. hist.push('2.084 - buy unknown upgrades if their price is 0.1% of cookie storage');
  35. hist.push('2.083 - mouse upgrades is processed as Upgrades');
  36. hist.push('2.082 - start from scratch');
  37. hist.push('2.080 - add history, add option "showTimeCompensate"');
  38. hist.push('2.079 - hide donate box');
  39. hist.push('2.078 - Kittens now is processed as Upgrades');
  40. return hist;
  41. }
  42.  
  43. var _getKittenPercentByUpgradeName = function(kName) {
  44. if (kName == 'Kitten helpers') return Game.milkProgress*0.1;
  45. if (kName == 'Kitten workers') return Game.milkProgress*0.125;
  46. if (kName == 'Kitten engineers') return Game.milkProgress*0.15;
  47. if (kName == 'Kitten overseers') return Game.milkProgress*0.175;
  48. if (kName == 'Kitten managers') return Game.milkProgress*0.2;
  49. if (kName == 'Kitten accountants') return Game.milkProgress*0.2;
  50. if (kName == 'Kitten specialists') return Game.milkProgress*0.2;
  51. if (kName == 'Kitten experts') return Game.milkProgress*0.2;
  52. if (kName == 'Kitten angels') return Game.milkProgress*0.1;
  53. return 0;
  54. }
  55.  
  56. var options = {
  57. bankStoragePercent: 100,
  58. showTimeCompensate: false,
  59. bankStorageAuto: false
  60. };
  61. var _store = function(name, value) {
  62. if (typeof(Storage) !== "undefined") localStorage.setItem(name, value);
  63. };
  64. var _restore = function(name) {
  65. if (typeof(Storage) !== "undefined") return localStorage.getItem(name);
  66. else return undefined;
  67. };
  68.  
  69. var _getBuffMult = function () {
  70. var buffMult = 1;
  71. for (var buff in Game.buffs) {
  72. if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
  73. buffMult = buffMult * Game.buffs[buff].multCpS;
  74. }
  75. }
  76. return buffMult === 0 ? 1 : buffMult;
  77. };
  78.  
  79. var _getNormalCookiesPs = function () {
  80. return Game.cookiesPs / _getBuffMult();
  81. };
  82.  
  83. var _getMinimalMoney = function () {
  84. return Math.floor(_getNormalCookiesPs() * 42100 * options.bankStoragePercent / 100);
  85. };
  86.  
  87. var _getMoneyCanSpend = function () {
  88. var moneyCanSpend = Game.cookies - _getMinimalMoney();
  89. return moneyCanSpend;
  90. };
  91.  
  92. var _getWrinklerCount = function () {
  93. var wrinklersCount = 0;
  94. for (var i in Game.wrinklers) {
  95. if (Game.wrinklers[i].sucked > 0) {
  96. wrinklersCount++;
  97. }
  98. }
  99. return wrinklersCount;
  100. };
  101.  
  102. var priorityListObj = {}, priorityList = [], timeCompensateObj = {}, timeCompensateList = [];
  103. var _createPriorityList = function() {
  104. var moneyCanSpend = _getMoneyCanSpend();
  105. var money = Game.cookies;
  106. var buffMult = _getBuffMult();
  107. priorityList = [];
  108. priorityListObj = {};
  109. for (var g in Game.UpgradesById) {
  110. if (Game.UpgradesById[g].bought === 0 && Game.UpgradesById[g].unlocked == 1) {
  111. var isMultiplier = Game.UpgradesById[g].desc.indexOf('production multiplier') >= 0;
  112. var isDouble = Game.UpgradesById[g].desc.indexOf('<b>twice</b>') >= 0;
  113. var isDoubleGrandma = Game.UpgradesById[g].desc.indexOf('Grandmas are <b>twice</b>') >= 0;
  114. var isKitten = Game.UpgradesById[g].name.indexOf('Kitten ') >= 0;
  115. var isDoubleCursor = Game.UpgradesById[g].desc.indexOf('The mouse and cursors are <b>twice</b>') >= 0;
  116. var isClickIncrease = Game.UpgradesById[g].desc.indexOf('Clicking gains <b>+1%') >= 0;
  117. var increasedMoney = 0;
  118. if (isClickIncrease) {
  119. increasedMoney = Game.cookiesPs * 0.01;
  120. } else if (isDoubleCursor) {
  121. increasedMoney = Game.Objects['Cursor'].storedTotalCps * Game.globalCpsMult / buffMult;
  122. } else if (isKitten) {
  123. var kittenPercent = _getKittenPercentByUpgradeName(Game.UpgradesById[g].name);
  124. increasedMoney = _getNormalCookiesPs() * kittenPercent;
  125. } else if (isDoubleGrandma) {
  126. increasedMoney = Game.Objects['Grandma'].storedTotalCps * Game.globalCpsMult / buffMult;
  127. } else if (isMultiplier) {
  128. increasedMoney = _getNormalCookiesPs() * Game.UpgradesById[g].power / 100;
  129. } else if (isDouble) {
  130. increasedMoney = Game.UpgradesById[g].buildingTie.storedTotalCps * Game.globalCpsMult / buffMult;
  131. }
  132. var interest = increasedMoney > 0 ? Game.UpgradesById[g].basePrice / increasedMoney : '-';
  133. if (interest != '-') {
  134. if (typeof priorityListObj[Math.floor(interest)] === 'undefined') {
  135. var pp = moneyCanSpend / Game.UpgradesById[g].basePrice; // percent of cheapness
  136. if (pp > 50) interest /= pp * 50;
  137. priorityListObj[Math.floor(interest)] = {
  138. name: Game.UpgradesById[g].name,
  139. title: Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].basePrice),
  140. price: Game.UpgradesById[g].basePrice,
  141. cps: 1,
  142. type: 'upgrade',
  143. id: g,
  144. income: increasedMoney
  145. };
  146. }
  147. } else if (Game.UpgradesById[g].type == 'upgrade' &&
  148. Game.UpgradesById[g].basePrice < moneyCanSpend &&
  149. Game.UpgradesById[g].pool != 'toggle' && Game.UpgradesById[g].pool != 'tech')
  150. {
  151. interest = Game.UpgradesById[g].basePrice / moneyCanSpend * 1000;
  152. if (typeof priorityListObj[Math.floor(interest)] === 'undefined') {
  153. pp = moneyCanSpend / Game.UpgradesById[g].basePrice; // percent of cheapness
  154. if (pp > 50) interest /= pp * 50;
  155. priorityListObj[Math.floor(interest)] = {
  156. name: Game.UpgradesById[g].name,
  157. title: Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].basePrice),
  158. price: Game.UpgradesById[g].basePrice,
  159. cps: 1,
  160. type: 'upgrade',
  161. id: g,
  162. income: 0
  163. };
  164. }
  165. }
  166. //priorityList.push(Game.UpgradesById[g].name + ' - ' + Beautify(Game.UpgradesById[g].basePrice) + ' (INTEREST: ' + Beautify(interest) + ')');
  167. }
  168. }
  169. for (var i in Game.ObjectsById) {
  170. if (typeof i !== 'undefined' && i != 'undefined' && Game.ObjectsById.hasOwnProperty(i)) {
  171. if (Game.ObjectsById[i].locked === 0) {
  172. var cps = (Game.ObjectsById[i].storedTotalCps / Game.ObjectsById[i].amount) * Game.globalCpsMult / buffMult;
  173. interest = Game.ObjectsById[i].price / cps;
  174. var pp = moneyCanSpend / Game.ObjectsById[i].price; // percent of cheapness
  175. if (pp > 50) interest /= pp * 50;
  176. if (isNaN(Math.floor(interest)) && Game.ObjectsById[i].price < moneyCanSpend) interest = 0;
  177. priorityListObj[Math.floor(interest)] = {
  178. name: Game.ObjectsById[i].name,
  179. title: Game.ObjectsById[i].name + ' - ' + Beautify(Game.ObjectsById[i].price),
  180. price: Game.ObjectsById[i].price,
  181. cps: cps,
  182. type: 'buy',
  183. id: i,
  184. income: cps
  185. };
  186. //priorityList.push(Game.ObjectsById[i].name + ' - ' + Beautify(Game.ObjectsById[i].price) + ' (INTEREST: ' + Beautify(interest) + ')');
  187. }
  188. }
  189. }
  190. for (i in priorityListObj) {
  191. var prefix = priorityListObj[i].price < moneyCanSpend ? '!!! ' : (priorityListObj[i].price < money ? '! ' : '');
  192. var pp = Math.floor(moneyCanSpend / priorityListObj[i].price * 100);
  193. priorityList.push(prefix + priorityListObj[i].title + ' : ' + i + ' (' + pp + '%)');
  194. }
  195.  
  196. timeCompensateObj = {};
  197. timeCompensateList = [];
  198. for (i in priorityListObj) {
  199. var o = priorityListObj[i];
  200. if (o.type == 'buy') {
  201. var cpsWithPercent = (o.cps / _getNormalCookiesPs() + 1) * o.cps;
  202. var interestNew = o.price / cpsWithPercent;
  203. timeCompensateObj[Math.floor(interestNew)] = {
  204. name: o.name,
  205. title: o.title,
  206. price: o.price,
  207. cps: cpsWithPercent,
  208. type: 'buy',
  209. id: o.id,
  210. income: o.income
  211. };
  212. } else {
  213. timeCompensateObj[i] = o;
  214. }
  215. }
  216. for (i in timeCompensateObj) {
  217. prefix = timeCompensateObj[i].price < moneyCanSpend ? '!!! ' : (timeCompensateObj[i].price < money ? '! ' : '');
  218. timeCompensateList.push(prefix + timeCompensateObj[i].title + ' : ' + i);
  219. }
  220. };
  221.  
  222. var _caption = function(txt) {
  223. var $v = jQuery('#versionNumber');
  224. if ($v.text() != txt) $v.text(txt);
  225. };
  226.  
  227. var _title = function(txt) {
  228. var newTitle = (newLogs > 0 ? '(' + newLogs + ') ' : '') + txt;
  229. if (document.title != newTitle) {
  230. oldTitle = txt;
  231. document.title = newTitle;
  232. }
  233. };
  234.  
  235. var _titlePercent = function(have, need, txt) {
  236. var percent = Math.ceil(have / (need !== 0 ? need : 1) * 100);
  237. _title(String(percent) + "% - " + txt);
  238. };
  239.  
  240. var _logSectionTitle = function (text) {
  241. return '<div class="title">' + text + '</div>';
  242. };
  243.  
  244. var _logSection = function (title, items) {
  245. return '<div class="subsection">' + _logSectionTitle(title) +
  246. '<div class="listing">' + items.join('</div><div class="listing">') + '</div>' +
  247. '</div>';
  248. };
  249. var clearLogButton = '<button data-id="clearLog" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">Clear Log</button>';
  250.  
  251. var _logPriorityTable = function() {
  252. var moneyCanSpend = _getMoneyCanSpend();
  253. var styles = '<style type="text/css">.prioritytable{width:100%;}.prioritytable td,.prioritytable th{padding:3px;}</style>';
  254. 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>';
  255. for (i in priorityListObj) {
  256. var o = priorityListObj[i];
  257. var pp = Math.floor(moneyCanSpend / o.price * 100);
  258. 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>';
  259. }
  260. t += '</table>';
  261. return styles + '<div class="subsection">' + _logSectionTitle('Priority ' + clearLogButton) + '<div class="listing">' + t + '</div></div>';
  262. }
  263. var _optionsSection = function() {
  264. var content = [];
  265. 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)" />');
  266. content.push('<button data-id="showTimeCompensate" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">showTimeCompensate: ' + (options.showTimeCompensate ? 'TRUE' : 'FALSE') + '</button>');
  267. content.push('<button data-id="bankStorageAuto" onclick="document.getElementById(\'logButton\').onbuttonclick(this,event)">bankStorageAuto: ' + (options.bankStorageAuto ? 'TRUE' : 'FALSE') + '</button>');
  268. content.push(clearLogButton);
  269. return content;
  270. };
  271.  
  272. var _infoSection = function() {
  273. var content = [];
  274. var wrinklersTotal = 0;
  275. for (var i in Game.wrinklers) {
  276. wrinklersTotal += Game.wrinklers[i].sucked;
  277. }
  278. content.push('Now clicking: ' + (isClickingNow ? "YES" : "NO"));
  279. content.push('Wrinklers: ' + _getWrinklerCount());
  280. content.push('Wrinklers sucked: ' + Beautify(wrinklersTotal));
  281. content.push('Buff mult: ' + _getBuffMult());
  282. content.push('Normal CpS: ' + Beautify(_getNormalCookiesPs()));
  283. content.push('Money bank: ' + Beautify(_getMinimalMoney()));
  284. content.push('Money can spend: ' + Beautify(_getMoneyCanSpend()));
  285. return content;
  286. }
  287.  
  288. var _updateLog = function () {
  289. Game.updateLog = logTitle +
  290. //_logSection('Priority ' + clearLogButton, priorityList) +
  291. _logPriorityTable() +
  292. (options.showTimeCompensate ? _logSection('Priority (time compensate)', timeCompensateList) : '') +
  293. _logSection('Info', _infoSection()) +
  294. _logSection('Log', log) +
  295. _logSection('Options', _optionsSection()) +
  296. _logSection('History', _history());
  297. var newButtonText = newLogs > 0 ? 'Log (' + newLogs + ')' : 'Log';
  298. if (jQuery('#logButton').text() != newButtonText) jQuery('#logButton').text(newButtonText);
  299. _title(oldTitle);
  300. };
  301.  
  302. var _setBankStogarePercent = function(val, needUpdate) {
  303. if (options.bankStoragePercent != val) {
  304. if (needUpdate === true) jQuery('#bankStoragePercent').val(val);
  305. if (console) console.log('bankStoragePercent =', val);
  306. _store('bankStoragePercent', val);
  307. options.bankStoragePercent = val;
  308. jQuery('#bankStoragePercentLabel').text('Storage (' + Beautify(_getMinimalMoney()) + ') percent: ' + val + '%');
  309. _updateLog();
  310. }
  311. }
  312.  
  313. document.getElementById('logButton').onsliderchange = function(el) {
  314. var val = $(el).val();
  315. _setBankStogarePercent(val);
  316. };
  317.  
  318. var _bankAutoFunction = function() {
  319. if (options.bankStorageAuto && priorityList.length > 0 && Game.OnAscend == 0) {
  320. for (var idx in priorityListObj) {
  321. var bankStorageNew = Math.floor(idx / 50000);
  322. if (bankStorageNew > 100) bankStorageNew = 100;
  323. if (!isNaN(bankStorageNew)) _setBankStogarePercent(bankStorageNew, true);
  324. else if (console) console.log('bankStorageNew error:', idx);
  325. break;
  326. }
  327. }
  328. };
  329.  
  330. document.getElementById('logButton').onbuttonclick = function(el,e) {
  331. e.preventDefault();
  332. var id = jQuery(el).attr('data-id');
  333. if (id == 'showTimeCompensate') {
  334. options.showTimeCompensate = !options.showTimeCompensate;
  335. if (console) console.log('showTimeCompensate =', options.showTimeCompensate ? 'TRUE' : 'FALSE');
  336. } else if (id == 'bankStorageAuto') {
  337. options.bankStorageAuto = !options.bankStorageAuto;
  338. _store('bankStorageAuto', options.bankStorageAuto);
  339. if (console) console.log('bankStorageAuto =', options.bankStorageAuto ? 'TRUE' : 'FALSE');
  340. _bankAutoFunction();
  341. } else if (id == 'clearLog') {
  342. log = [];
  343. newLogs = 0;
  344. }
  345. jQuery(el).attr('disabled', 'disabled');
  346. _updateLog();
  347. }
  348.  
  349. var _addLog = function(text) {
  350. var t = new Date();
  351. log.push(t.toUTCString() + ': ' + text);
  352. newLogs++;
  353. _updateLog();
  354. };
  355.  
  356. jQuery('#logButton').text('Log').on("click", function() {
  357. newLogs = 0;
  358. jQuery('#logButton').text('Log');
  359. });
  360.  
  361. var _killAllWrinklers = function () {
  362. var wrinklersCount = _getWrinklerCount();
  363. if (wrinklersCount >= 10 || Game.hasBuff('Elder frenzy')) {
  364. var wrinklesIncome = 0;
  365. for (var i in Game.wrinklers) {
  366. wrinklesIncome += Game.wrinklers[i].sucked;
  367. Game.wrinklers[i].hp = 0; // kill ALL
  368. }
  369. if (wrinklesIncome > 0) {
  370. _addLog('Killed all Wrinkles for ' + Beautify(wrinklesIncome) + ' because of ' + (Game.hasBuff('Elder frenzy') ? '"Elder frenzy"' : 'count 10.'));
  371. }
  372. }
  373. };
  374.  
  375. var _makeABuy = function() {
  376.  
  377. _killAllWrinklers();
  378.  
  379. var moneyCanSpend = _getMoneyCanSpend();
  380.  
  381. if (moneyCanSpend < 0) {
  382. var minimalMoney = _getMinimalMoney();
  383. _caption('Collecting minimum ' + Beautify(minimalMoney));
  384. _titlePercent(Game.cookies, minimalMoney, 'minimum');
  385. return;
  386. }
  387. var needToBuy = undefined, needToBuyInterest = undefined;
  388. if (priorityList.length > 0) {
  389. for (var idx in priorityListObj) {
  390. needToBuy = priorityListObj[idx];
  391. needToBuyInterest = idx;
  392. if (needToBuy.type == 'upgrade') {
  393. _caption('Upgrading ' + needToBuy.name + ' for ' + Beautify(needToBuy.price));
  394. if (needToBuy.price < moneyCanSpend) {
  395. if (Game.UpgradesById[needToBuy.id].canBuy()) {
  396. Game.UpgradesById[needToBuy.id].buy();
  397. _addLog('Buy upgrade ' + Game.UpgradesById[needToBuy.id].name + ' for ' + Beautify(needToBuy.price));
  398. _createPriorityList();
  399. }
  400. } else {
  401. _titlePercent(moneyCanSpend, needToBuy.price, Game.UpgradesById[needToBuy.id].name);
  402. }
  403. } else {
  404. _caption('Collecting ' + Beautify(needToBuy.price) + ' for ' + needToBuy.name);
  405. if (Game.ObjectsById[needToBuy.id].price < moneyCanSpend) {
  406. var amount = 1;
  407. if (Game.ObjectsById[needToBuy.id].getSumPrice(100) < moneyCanSpend) {
  408. Game.ObjectsById[needToBuy.id].buy(100);
  409. amount = 100;
  410. } else if (Game.ObjectsById[needToBuy.id].getSumPrice(10) < moneyCanSpend) {
  411. Game.ObjectsById[needToBuy.id].buy(10);
  412. amount = 10;
  413. } else {
  414. Game.ObjectsById[needToBuy.id].buy(1);
  415. }
  416. _addLog('Buy ' + amount + ' object ' + Game.ObjectsById[needToBuy.id].name + ' for ' + Beautify(Game.ObjectsById[needToBuy.id].price));
  417. _createPriorityList();
  418. } else {
  419. _titlePercent(moneyCanSpend, needToBuy.price, Game.ObjectsById[needToBuy.id].name);
  420. }
  421. }
  422. break;
  423. }
  424. }
  425. };
  426.  
  427. var startT = function() {
  428. t2 = setInterval(_makeABuy, 500);
  429.  
  430. started = true;
  431. _caption('Started');
  432. _addLog('Autobuy start!');
  433. };
  434.  
  435. var stopT = function() {
  436. clearInterval(t2);
  437. started = false;
  438. _caption('Collecting gold...');
  439. _addLog('Autobuy stop.');
  440. };
  441.  
  442. jQuery('#versionNumber').on("click", function() {
  443. if (!started)
  444. startT();
  445. else
  446. stopT();
  447. });
  448.  
  449. options.bankStoragePercent = _restore('bankStoragePercent');
  450. if (typeof options.bankStoragePercent === 'undefined' || options.bankStoragePercent === null) {
  451. options.bankStoragePercent = 100;
  452. }
  453. options.bankStorageAuto = _restore('bankStorageAuto');
  454. if (typeof options.bankStorageAuto === 'undefined' || options.bankStorageAuto === null) {
  455. options.bankStorageAuto = false;
  456. }
  457.  
  458. setTimeout(function() {
  459. jQuery('#donateBox').hide();
  460. tPriority = setInterval(function () {
  461. _createPriorityList();
  462. _updateLog();
  463. }, 1000);
  464.  
  465. tLog = setInterval(function () {
  466. _updateLog();
  467. }, 600);
  468.  
  469. tReloadPageOnWrongBuff = setInterval(function() {
  470. if (_getBuffMult() < 1) {
  471. var hasBuffsToKill = false;
  472. for (var buff in Game.buffs) {
  473. if (Game.buffs[buff] !== 0 && typeof Game.buffs[buff].multCpS !== 'undefined') {
  474. Game.buffs[buff].time = 0; // remove all buffs, not only negative (not cheating)
  475. hasBuffsToKill = true;
  476. }
  477. }
  478. if (hasBuffsToKill) _addLog('Remove all buffs because of negative multiplier');
  479. }
  480. }, 1000);
  481.  
  482. tAscendDetector = setInterval(function() {
  483. if (Game.OnAscend == 1) {
  484. _setBankStogarePercent(0, true);
  485. }
  486. }, 1000);
  487.  
  488. t3 = setInterval(function() {
  489. var golden = Game.shimmers;
  490. if (golden.length > 0) {
  491. for (var i in golden) {
  492. golden[i].pop();
  493. }
  494. }
  495. }, 500);
  496.  
  497. tBankAuto = setInterval(_bankAutoFunction, 600001); // 10 minutes
  498.  
  499. tClickFrenzy = setInterval(function() {
  500. if (Game.hasBuff('Click frenzy') ||
  501. Game.hasBuff('Cursed finger') ||
  502. Game.hasBuff('Elder frenzy') ||
  503. Game.hasBuff('Dragon Harvest') ||
  504. Game.hasBuff('Dragonflight') ||
  505. Game.cookiesPs < 1000000) {
  506. Game.ClickCookie();
  507. isClickingNow = true;
  508. } else {
  509. isClickingNow = false;
  510. }
  511. }, 75);
  512.  
  513. if (Game.cookiesPs < 1E6) {
  514. tClick = setInterval(function() {
  515. Game.mouseX = jQuery('#bigCookie').width() / 2 + jQuery('#bigCookie').offset().left;
  516. Game.mouseY = jQuery('#bigCookie').height() / 2 + jQuery('#bigCookie').offset().top;
  517. Game.ClickCookie();
  518. if (Game.cookiesPs > 1E8) clearInterval(tClick);
  519. }, 300);
  520. }
  521.  
  522. _caption('Collecting gold...');
  523. _bankAutoFunction();
  524. }, 5000);
  525. })();