This repository has been archived by the owner on Dec 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold_cookie_cheat.py
123 lines (113 loc) · 3.68 KB
/
old_cookie_cheat.py
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
# coding: utf-8
'''conjure_calc: Checks optimal cookies saved for conjuring.
autoclick: Automatically clicks where the cookie is.
Stop the autoclick by moving the mouse to the top left.
'''
import pyautogui
import time
def num_humanize(num):
''' Convert big numbers to small numbers like the game does.
'''
num_dict = {
1e6: 'm', # million
1e9: 'b', # billion
1e12: 't', # trillion
1e15: 'qd', # quadrillion
1e18: 'qt', # quintillion
1e21: 'sx', # sextillion
1e24: 'sp', # septillion
1e27: 'oct',# octillion
1e30: 'non' # nonillion
}
if num > 1e30:
num = num/1e30
return str(num) + num_dict[1e30]
elif num > 1e27:
num = num/1e27
return str(num) + num_dict[1e27]
elif num > 1e24:
num = num/1e24
return str(num) + num_dict[1e24]
elif num > 1e21:
num = num/1e21
return str(num) + num_dict[1e21]
elif num > 1e18:
num = num/1e18
return str(num) + num_dict[1e18]
elif num > 1e15:
num = num/1e15
return str(num) + num_dict[1e15]
elif num > 1e12:
num = num/1e12
return str(num) + num_dict[1e12]
elif num > 1e9:
num = num/1e9
return str(num) + num_dict[1e9]
elif num > 1e6:
num = num/1e6
return str(num) + num_dict[1e6]
else:
return num
def num_biggify(human_num):
''' Turn a human-input string into a computer number.
'''
if human_num.endswith('non'):
human_num = human_num[:-3]
human_num = float(human_num) * 1e30
return human_num
elif human_num.endswith('oct'):
human_num = human_num[:-3]
human_num = float(human_num) * 1e27
return human_num
elif human_num.endswith('sp'):
human_num = human_num[:-2]
human_num = float(human_num) * 1e24
return human_num
elif human_num.endswith('sx'):
human_num = human_num[:-2]
human_num = float(human_num) * 1e21
return human_num
elif human_num.endswith('qt'):
human_num = human_num[:-2]
human_num = float(human_num) * 1e18
return human_num
elif human_num.endswith('qd'):
human_num = human_num[:-2]
human_num = float(human_num) * 1e15
return human_num
elif human_num.endswith('t'):
human_num = human_num[:-1]
human_num = float(human_num) * 1e12
return human_num
elif human_num.endswith('b'):
human_num = human_num[:-1]
human_num = float(human_num) * 1e9
return human_num
elif human_num.endswith('m'):
human_num = human_num[:-1]
human_num = float(human_num) * 1e6
return human_num
def conjure_calc(cps):
''' Checks the desired minimum number of cookies to make casting
the spell "Conjure Baked Goods" worth it.
Requires Grimoire (Wizard Tower lvl1 upgrade)'''
cps = num_biggify(cps)
cps = cps * 60 * 30 / 0.15
return num_humanize(cps)
def autoclick():
'''Automatically clicks where the cookie is. Doesn't switch the window or anything,
so make sure you can see the cookie outside your terminal. Move mouse to topleft to
escape this horrible forever loop.'''
while True:
time.sleep(.01)
pyautogui.click(x=250, y=450, clicks=500, interval=0.01)
def pledger():
while True:
pyautogui.click(975, 630)
time.sleep(.05)
pyautogui.click(975, 630)
time.sleep(.05)
pyautogui.click(1035, 630)
time.sleep(.05)
# TODO: Add converter small-numbers functionality,
# user sets where they are (million, billion, trillion)