-
Notifications
You must be signed in to change notification settings - Fork 1
/
cookieclickercheat.js
483 lines (483 loc) · 14.6 KB
/
cookieclickercheat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
var next='None';
var clicking=false;
var speedbaking=false;
var resettable=false;
var timer;
var resetRatio=0.15;
var wrinklersNum=0;
var cookiesGetLastGame;
var resetGoldenBaseNum=300;
function startClicking(){
timer=setInterval('Game.ClickCookie()' , 100);
}
function stopClicking(){
clearInterval(timer);
}
function resetnum(){
return Game.cookiesReset*resetRatio;
}
function gameReset(){
if(resettable){
cookiesGetLastGame=Game.cookiesEarned;
Game.Reset(1);
resettable=false;
}
if(Game.goldenClicksLocal>=resetGoldenNum() && Game.frenzy==0 && Game.goldenCookie.chain==0 && Game.clickFrenzy==0){
resettable=true;
}
}
function resetGoldenNum(){
return resetGoldenBaseNum*(Game.Has('Lucky day')?2:1)*(Game.Has('Serendipity')?2:1);
}
function currentCps(){
return Game.cookiesPs*((Game.frenzy>0)?Game.frenzyPower:1);
}
function goldenClick(){
if(Game.goldenCookie.life>0){
Game.goldenCookie.click();
}
}
function seasonPopupClick(){
if(Game.seasonPopup.life>0&&(Game.seasonPopup.life<Game.fps||Game.frenzy>0)){
Game.seasonPopup.click();
}
}
function wrinklersClick(){
for(var i in Game.wrinklers){
if(Game.frenzy==0&&Game.wrinklers[i].sucked>currentCps()*60){
Game.wrinklers[i].hp=0;
}
}
}
function cookieClicking(){
if((Game.clickFrenzy>0||Game.cookiesPs<=Game.mouseCps()*10||speedbaking)&&!clicking){
startClicking();
clicking=true;
}
if((Game.clickFrenzy==0&&Game.cookiesPs>Game.mouseCps()*10&&!speedbaking)&&clicking){
stopClicking();
clicking=false;
}
}
var buy=function(){
gameReset();
seasonPopupClick();
wrinklersClick();
goldenClick();
cookieClicking();
if(Game.BuildingsOwned == 0){
if(Game.cookies>=15){
Game.Objects['Cursor'].buy();
console.log('Buy:Cursor');
}
}else{
var build='Cursor';
var wait=Game.Objects[build].getPrice()/Game.cookiesPs;
var value=Math.log(1+Game.Objects[build].cps()/Game.cookiesPs)/wait;
for(var i in Game.Objects){
var iwait=Game.Objects[i].getPrice()/Game.cookiesPs;
var ivalue=Math.log(1+Game.Objects[i].cps()/Game.cookiesPs)/iwait;
if(value<ivalue){
build=Game.Objects[i].name;
value=ivalue;
}
}
var upgrade='none';
var upwait=0;
var upvalue=0;
for(var i in Game.UpgradesInStore){
var iwait=Game.UpgradesInStore[i].getPrice()/Game.cookiesPs;
var ivalue=0;
var name=Game.UpgradesInStore[i].name;
var gain=0;
var twait=(Game.UpgradesInStore[i].getPrice()+addition)/currentCps();
if(iwait<=300){
switch(name){
case 'Reinforced index finger':
gain=0.1*Game.Objects['Cursor'].amount;
break;
case 'Carpal tunnel prevention cream':
case 'Ambidextrous':
gain=Game.Objects['Cursor'].cps()*Game.Objects['Cursor'].amount;
break;
case 'Thousand fingers':
gain=0.1*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Million fingers':
gain=0.5*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Billion fingers':
gain=2*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Trillion fingers':
gain=10*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Quadrillion fingers':
gain=20*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Quintillion fingers':
gain=100*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Sextillion fingers':
gain=200*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Septillion fingers':
gain=400*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Octillion fingers':
gain=800*(Game.BuildingsOwned-Game.Objects['Cursor'].amount);
break;
case 'Forwards from grandma':
gain=0.3*Game.Objects['Grandma'].amount;
break;
case 'Steel-plated rolling pins':
case 'Lubricated dentures':
case 'Prune juice':
case 'Double-thick glasses':
case 'Farmer grandmas':
case 'Worker grandmas':
case 'Miner grandmas':
case 'Cosmic grandmas':
case 'Transmuted grandmas':
case 'Altered grandmas':
case 'Grandmas\' grandmas':
case 'Antigrandmas':
case 'Rainbow grandmas':
case 'Aging agents':
gain=Game.Objects['Grandma'].cps()*Game.Objects['Grandma'].amount;
break;
case 'Cheap hoes':
gain=1*Game.Objects['Farm'].amount;
break;
case 'Fertilizer':
case 'Cookie trees':
case 'Genetically-modified cookies':
case 'Gingerbread scarecrows':
case 'Pulsar sprinklers':
gain=Game.Objects['Farm'].cps()*Game.Objects['Farm'].amount;
break;
case 'Sturdier conveyor belts':
gain=4*Game.Objects['Factory'].amount;
break;
case 'Child labor':
case 'Sweatshop':
case 'Radium reactors':
case 'Recombobulators':
case 'Deep-bake process':
gain=Game.Objects['Factory'].cps()*Game.Objects['Factory'].amount;
break;
case 'Sugar gas':
gain=10*Game.Objects['Mine'].amount;
break;
case 'Megadrill':
case 'Ultradrill':
case 'Ultimadrill':
case 'H-bomb mining':
case 'Coreforge':
gain=Game.Objects['Mine'].cps()*Game.Objects['Mine'].amount;
break;
case 'Vanilla nebulae':
gain=30*Game.Objects['Shipment'].amount;
break;
case 'Wormholes':
case 'Frequent flyer':
case 'Warp drive':
case 'Chocolate monoliths':
case 'Generation ship':
gain=Game.Objects['Shipment'].cps()*Game.Objects['Shipment'].amount;
break;
case 'Antimony':
gain=100*Game.Objects['Alchemy lab'].amount;
break;
case 'Essence of dough':
case 'True chocolate':
case 'Ambrosia':
case 'Aqua crustulae':
case 'Origin crucible':
gain=Game.Objects['Alchemy lab'].cps()*Game.Objects['Alchemy lab'].amount;
break;
case 'Ancient tablet':
gain=1666*Game.Objects['Portal'].amount;
break;
case 'Insane oatling workers':
case 'Soul bond':
case 'Sanity dance':
case 'Brane transplant':
case 'Deity-sized portals':
gain=Game.Objects['Portal'].cps()*Game.Objects['Portal'].amount;
break;
case 'Flux capacitors':
gain=9876*Game.Objects['Time machine'].amount;
break;
case 'Time paradox resolver':
case 'Quantum conundrum':
case 'Causality enforcer':
case 'Yestermorrow comparators':
case 'Far future enactment':
gain=Game.Objects['Time machine'].cps()*Game.Objects['Time machine'].amount;
break;
case 'Sugar bosons':
gain=99999*Game.Objects['Antimatter condenser'].amount;
break;
case 'String theory':
case 'Large macaron collider':
case 'Big bang bake':
case 'Reverse cyclotrons':
case 'Nanocosmics':
gain=Game.Objects['Antimatter condenser'].cps()*Game.Objects['Antimatter condenser'].amount;
break;
case 'Gem polish':
gain=1000000*Game.Objects['Prism'].amount;
break;
case '9th color':
case 'Chocolate light':
case 'Grainbow':
case 'Pure cosmic light':
case 'Glow-in-the-dark':
gain=Game.Objects['Prism'].cps()*Game.Objects['Prism'].amount;
break;
case 'Oatmeal raisin cookies':
case 'Peanut butter cookies':
case 'Plain cookies':
case 'Sugar cookies':
case 'Coconut cookies':
case 'White chocolate cookies':
case 'Macadamia nut cookies':
gain=Game.cookiesPs/Game.globalCpsMult*0.05;
break;
case 'Double-chip cookies':
case 'White chocolate macadamia nut cookies':
case 'All-chocolate cookies':
gain=Game.cookiesPs/Game.globalCpsMult*0.1;
break;
case 'Dark chocolate-coated cookies':
case 'White chocolate-coated cookies':
case 'Eclipse cookies':
case 'Zebra cookies':
case 'Snickerdoodles':
case 'Stroopwafels':
case 'Macaroons':
case 'Empire biscuits':
case 'British tea biscuits':
case 'Chocolate british tea biscuits':
case 'Round british tea biscuits':
case 'Round chocolate british tea biscuits':
case 'Round british tea biscuits with heart motif':
case 'Round chocolate british tea biscuits with heart motif':
gain=Game.cookiesPs/Game.globalCpsMult*0.15;
break;
case 'Madeleines':
case 'Palets':
case 'Palmiers':
case 'Sablés':
case 'Skull cookies':
case 'Ghost cookies':
case 'Bat cookies':
case 'Slime cookies':
case 'Pumpkin cookies':
case 'Eyeball cookies':
case 'Spider cookies':
case 'Christmas tree biscuits':
case 'Snowflake biscuits':
case 'Snowman biscuits':
case 'Holly biscuits':
case 'Candy cane biscuits':
case 'Bell biscuits':
case 'Present biscuits':
gain=Game.cookiesPs/Game.globalCpsMult*0.2;
break;
case 'Caramoas':
case 'Sagalongs':
case 'Shortfoils':
case 'Win mints':
case 'Fig gluttons':
case 'Loreols':
case 'Jaffa cakes':
case 'Grease\'s cups':
case 'Gingerbread men':
case 'Gingerbread trees':
case 'Pure heart biscuits':
case 'Ardent heart biscuits':
case 'Sour heart biscuits':
case 'Weeping heart biscuits':
case 'Golden heart biscuits':
case 'Eternal heart biscuits':
gain=Game.cookiesPs/Game.globalCpsMult*0.25;
break;
case 'Rose macarons':
case 'Lemon macarons':
case 'Chocolate macarons':
case 'Pistachio macarons':
case 'Hazelnut macarons':
case 'Violet macarons':
gain=Game.cookiesPs/Game.globalCpsMult*0.3;
break;
case 'Season switcher':
case 'Ghostly biscuit':
if(Game.Has('One mind')&&!Game.Has('Elder Pact')){
Game.Upgrades[name].buy();
return;
}
break;
case 'Lovesick biscuit':
if(Game.Has('Elder Pact')&&!Game.Has('Eternal heart biscuits')){
Game.Upgrades[name].buy();
return;
}
break;
case 'Festive biscuit':
if(Game.Has('Elder Pact')&&Game.Has('Eternal heart biscuits')){
Game.Upgrades[name].buy();
return;
}
break;
case 'A festive hat':
gain=10e14;
break;
case 'Increased merriness':
case 'Improved jolliness':
gain=Game.cookiesPs/Game.globalCpsMult*0.15;
break;
case 'A lump of coal':
case 'An itchy sweater':
gain=Game.cookiesPs/Game.globalCpsMult*0.01;
break;
case 'Reindeer baking grounds':
case 'Weighted sleighs':
case 'Ho ho ho-flavored frosting':
case 'Season savings':
case 'Toy workshop':
gain=10e14;
break;
case 'Naughty list':
gain=Game.Objects['Grandma'].cps()*Game.Objects['Grandma'].amount;
break;
case 'Santa\'s bottomless bag':
case 'Santa\'s helpers':
gain=10e14;
break;
case 'Santa\'s legacy':
gain=Game.cookiesPs/Game.globalCpsMult*(Game.santaLevel+1)*0.1;;
break;
case 'Santa\'s milk and cookies':
var mult=1;
if (Game.Has('Kitten helpers')) mult*=(1+Game.milkProgress*0.05*0.05);
if (Game.Has('Kitten workers')) mult*=(1+Game.milkProgress*0.1*0.05);
if (Game.Has('Kitten engineers')) mult*=(1+Game.milkProgress*0.2*0.05);
if (Game.Has('Kitten overseers')) mult*=(1+Game.milkProgress*0.2*0.05);
gain=Game.cookiesPs/Game.globalCpsMult*mult;
break;
gain=10e14;
break;
case 'Santa\'s dominion':
gain=Game.cookiesPs/Game.globalCpsMult*0.5;
break;
case 'Bingo center/Research facility':
case 'Persistent memory':
case 'Specialized chocolate chips':
case 'Designer cocoa beans':
case 'Ritual rolling pins':
case 'Underworld ovens':
case 'Exotic nuts':
case 'Communal brainsweep':
case 'Arcane sugar':
case 'Elder Pact':
case 'Sacrificial rolling pins':
if(Game.cookies>Game.Upgrades[name].getPrice()){
Game.Upgrades[name].buy();
return;
}
break;
case 'One mind':
if(Game.cookies>Game.Upgrades[name].getPrice()){
Game.Upgrades[name].earn();
return;
}
case 'Elder Pledge':
if(Game.cookies>Game.Upgrades[name].getPrice()){
Game.Upgrades[name].buy();
return;
}
break;
case 'Plastic mouse':
case 'Iron mouse':
case 'Titanium mouse':
case 'Adamantium mouse':
case 'Unobtainium mouse':
case 'Eludium mouse':
case 'Wishalloy mouse':
if(Game.cookies>Game.Upgrades[name].getPrice()){
Game.Upgrades[name].buy();
return;
}
break;
case 'Lucky day':
case 'Serendipity':
case 'Kitten helpers':
case 'Kitten workers':
case 'Kitten engineers':
case 'Kitten overseers':
case 'Kitten managers':
case 'Get lucky':
if(Game.cookies>Game.Upgrades[name].getPrice()){
Game.Upgrades[name].buy();
return;
}
break;
case 'Heavenly chip secret':
if(!speedbaking){
var mult=parseFloat(Game.prestige['Heavenly chips'])*0.02*0.05;
gain=Game.cookiesPs/Game.globalCpsMult*mult;
}
break;
case 'Heavenly cookie stand':
if(!speedbaking){
var mult=parseFloat(Game.prestige['Heavenly chips'])*0.02*0.2;
gain=Game.cookiesPs/Game.globalCpsMult*mult;
}
break;
case 'Heavenly bakery':
case 'Heavenly confectionery':
case 'Heavenly key':
if(!speedbaking){
var mult=parseFloat(Game.prestige['Heavenly chips'])*0.02*0.25;
gain=Game.cookiesPs/Game.globalCpsMult*mult;
}
break;
}
}
ivalue=Math.log(1+gain/Game.cookiesPs)/iwait;
if(upvalue<ivalue){
upgrade=Game.UpgradesInStore[i].name;
upvalue=ivalue;
}
}
var ratio=(Game.UpgradesOwned>150)?150:Game.UpgradesOwned;
var time=(Game.Has('Get lucky'))?150:73;
var maxtime=Game.fps*time;
var frenzy=(Game.frenzy>0 && Game.frenzy<maxtime)?Game.frenzyPower:1;
var addition=84000*Game.cookiesPs/frenzy*(ratio*ratio)/(150*150)
if(value>=upvalue){
var border=Game.Objects[build].getPrice()+(speedbaking?0:addition);
if(Game.cookies>border || Game.Objects[build].getPrice()<Game.cookiesPs/frenzy){
console.log('Buy:'+build);
Game.Objects[build].buy();
next='none';
}else if(next!=build){
console.log('Next:'+build+'('+Beautify(border)+')');
next=build;
}
}else{
var border=Game.Upgrades[upgrade].getPrice()+(speedbaking?0:addition);
if(Game.cookies>border || Game.Upgrades[upgrade].getPrice()<Game.cookiesPs/frenzy){
console.log('Buy:'+upgrade);
Game.Upgrades[upgrade].buy();
next='none';
}else if(next!=upgrade){
console.log('Next:'+upgrade+'('+Beautify(border)+')');
next=upgrade;
}
}
}
};
setInterval('buy()',500);