-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcrypt.py
More file actions
executable file
·95 lines (87 loc) · 2.63 KB
/
crypt.py
File metadata and controls
executable file
·95 lines (87 loc) · 2.63 KB
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
#!/usr/bin/env python3
from automate import Automator
import time
import argparse
common_crypts = ["crypts/" + name for name in ["cave", "cog", "dune", "greek", "grotto", "ice", "lava", "rune", "skull", "snake", "temple", "pyramid"]]
rare_crypts = ["crypts/" + name for name in ["left", "right"]]
epic_crypts = ["crypts/" + name for name in ["darktree", "tomb", "labyrinth", "rock", "staired", "spike", "ring", "lighttree", "steppyramid", "epicpyramid", "redtree", "cathedral", "crystal", "palace", "pit", "scorpion", "haunted"]]
def crypt(a):
if not a.await_samples("watchtower", 2):
return False
a.click()
if not a.await_samples(["crypts_selected", "crypts_unselected"], 2):
return False
a.click()
time.sleep(0.4)
if not a.await_samples_multi("go_watchtower", 2):
return False
if not a.random_multi():
return False
a.click()
if not a.await_samples("logo", 2):
return False
a.move()
time.sleep(0.4)
if not a.await_samples_multi(crypts, 4):
return False
a.multi_block_color(140, 100, (48, 37, 130))
a.multi_block_color(140, 100, (254, 74, 32))
if not a.central_multi():
return False
a.click()
if not a.await_samples("logo", 2):
return False
a.move()
time.sleep(0.3)
if not a.await_samples("carter_selected", 2):
return False
if not a.await_samples("selected", 2):
return False
if rare:
if not a.await_samples("rare_open", 2):
return False
a.click()
if not a.await_samples("explore", 2):
return False
a.click(0, 10)
if not a.await_samples("carter_march", 2):
return False
return True
def speedup(a):
if a.await_samples("carter_march", 2):
a.click(190, 8)
if not a.await_samples("speedup", 2):
return True
for _ in range(6):
a.click(360, 36)
time.sleep(1.5)
return True
return False
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--type", default = "common", help = "crypt type")
args = parser.parse_args()
crypt_type = args.type
rare = False
if crypt_type == "common":
crypts = common_crypts
elif crypt_type == "epic":
crypts = epic_crypts
elif crypt_type == "rare":
crypts = rare_crypts
rare = True
else:
print("Unknown crypt type")
exit(1)
a = Automator()
fails = 0
last_restart = time.time()
while True:
if fails >= 10 or time.time() > last_restart + 900:
a.restart_game(True)
last_restart = time.time()
fails = 0
if not speedup(a):
if crypt(a):
fails = 0
else:
fails += 1