-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathshield.py
89 lines (62 loc) · 1.64 KB
/
shield.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
from _move import *
# import threading
# from _utils import *
import time
def screenshot():
print("Taking screenshot in 5 seconds.")
time.sleep(5)
filename = take_screenshot(WINDOW_TOP_LEFT[0], WINDOW_TOP_LEFT[1], WINDOW_BOTTOM_RIGHT[0], WINDOW_BOTTOM_RIGHT[1])
print(f"Created {filename}")
def activateShield():
print("CLICKING : BAG_OPEN")
click_mouse_at(BAG_OPEN)
print("CLICKING : COMBAT_TAB")
click_mouse_at(COMBAT_TAB)
print("CLICKING : LOWEST_SHIELD")
click_mouse_at(LOWEST_SHIELD)
print("CLICKING : BAG_CLOSE")
click_mouse_at(BAG_CLOSE)
# click_mouse_at(LOWEST_SHIELD)
def shield():
print("CLICKING : SHIELD")
time.sleep(5)
# screenshot()
# (1) Naive
# Shield when expired
# recurringly run every 4 hours
activateShield()
# (2) Smart
# determine if being attacked...
# (3) Ideal
# Shield when attacked by X 4Ts
# Screen in top left.
# Repeatedly move right until X + Screen_X > Max_X
# Move down Y
# Recursively do this zip zag until match
# Failure at bottom corner
print("Complete.")
time.sleep(5)
def mystery_box():
# every hour
print("CLICKING : MYSTERY BOX")
time.sleep(5)
click_mouse_at(MYSTERY_BOX)
click_mouse_at(MYSTERY_BOX_CLAIM)
def controller():
starttime=time.time()
seconds_in_ten=605.0 #600
count_til_shield = 22
while True:
mystery_box()
count_til_shield -= 1
if count_til_shield == 0:
shield()
count_til_shield = 24
time.sleep(seconds_in_ten - ((time.time() - starttime) % seconds_in_ten))
# threading.Timer(60, mystery_box).start()
# threading.Timer(240, shield).start()
def valid_commands():
pass
if __name__ == '__main__':
# screenshot()
controller()