|
@@ -1,5 +1,5 @@
|
1
|
1
|
import cv2
|
2
|
|
-import time
|
|
2
|
+import time, random
|
3
|
3
|
import pyautogui
|
4
|
4
|
from datetime import datetime, date
|
5
|
5
|
|
|
@@ -19,9 +19,16 @@ def find_image(image, coef=None):
|
19
|
19
|
print("Error while searching for image")
|
20
|
20
|
return None
|
21
|
21
|
|
|
22
|
+def sleeper():
|
|
23
|
+ # Random Time
|
|
24
|
+ time.sleep(random.choices(population=[int(1),int(2),int(3),int(4),int(5),int(6),int(7),int(8)],
|
|
25
|
+ weights=[0.03, 0.07, 0.1, 0.3, 0.3, 0.1, 0.07, 0.03])[0])
|
|
26
|
+ return
|
|
27
|
+
|
|
28
|
+
|
22
|
29
|
def loop():
|
23
|
30
|
while True:
|
24
|
|
- time.sleep(1)
|
|
31
|
+ sleeper()
|
25
|
32
|
pyautogui.screenshot("screenshot.png")
|
26
|
33
|
|
27
|
34
|
v_options = False
|
|
@@ -33,7 +40,7 @@ def loop():
|
33
|
40
|
# Options
|
34
|
41
|
|
35
|
42
|
while v_options == False:
|
36
|
|
- time.sleep(3)
|
|
43
|
+ sleeper()
|
37
|
44
|
pyautogui.screenshot("screenshot.png")
|
38
|
45
|
options = find_image("options.png")
|
39
|
46
|
if options != None:
|
|
@@ -41,12 +48,12 @@ def loop():
|
41
|
48
|
pyautogui.click((options[0], options[1]))
|
42
|
49
|
else:
|
43
|
50
|
print(f"Zahnräder nicht gefunden")
|
44
|
|
- time.sleep(3)
|
|
51
|
+ sleeper()
|
45
|
52
|
|
46
|
53
|
# Surrender
|
47
|
54
|
|
48
|
55
|
while v_surrender == False:
|
49
|
|
- time.sleep(3)
|
|
56
|
+ sleeper()
|
50
|
57
|
pyautogui.screenshot("screenshot.png")
|
51
|
58
|
surrender = find_image("surrender.png")
|
52
|
59
|
if surrender != None:
|
|
@@ -54,12 +61,12 @@ def loop():
|
54
|
61
|
pyautogui.click((surrender[0], surrender[1]))
|
55
|
62
|
else:
|
56
|
63
|
print(f"Surrender nicht gefunden")
|
57
|
|
- time.sleep(3)
|
|
64
|
+ sleeper()
|
58
|
65
|
|
59
|
66
|
# OK
|
60
|
67
|
|
61
|
68
|
while v_ok == False:
|
62
|
|
- time.sleep(3)
|
|
69
|
+ sleeper()
|
63
|
70
|
pyautogui.screenshot("screenshot.png")
|
64
|
71
|
ok = find_image("ok.png")
|
65
|
72
|
if ok != None:
|
|
@@ -67,12 +74,12 @@ def loop():
|
67
|
74
|
pyautogui.click((ok[0], ok[1]))
|
68
|
75
|
else:
|
69
|
76
|
print(f"OK nicht gefunden")
|
70
|
|
- time.sleep(3)
|
|
77
|
+ sleeper()
|
71
|
78
|
|
72
|
79
|
# Continue
|
73
|
80
|
|
74
|
81
|
while v_continue == False:
|
75
|
|
- time.sleep(3)
|
|
82
|
+ sleeper()
|
76
|
83
|
pyautogui.screenshot("screenshot.png")
|
77
|
84
|
f_continue = find_image("continue.png")
|
78
|
85
|
if f_continue != None:
|
|
@@ -80,12 +87,12 @@ def loop():
|
80
|
87
|
pyautogui.click((f_continue[0], f_continue[1]))
|
81
|
88
|
else:
|
82
|
89
|
print(f"Continue nicht gefunden")
|
83
|
|
- time.sleep(3)
|
|
90
|
+ sleeper()
|
84
|
91
|
|
85
|
92
|
# Ready
|
86
|
93
|
|
87
|
94
|
while v_ready == False:
|
88
|
|
- time.sleep(3)
|
|
95
|
+ sleeper()
|
89
|
96
|
pyautogui.screenshot("screenshot.png")
|
90
|
97
|
ready = find_image("ready.png")
|
91
|
98
|
if ready != None:
|
|
@@ -93,7 +100,7 @@ def loop():
|
93
|
100
|
pyautogui.click((ready[0], ready[1]))
|
94
|
101
|
else:
|
95
|
102
|
print(f"Ready nicht gefunden")
|
96
|
|
- time.sleep(3)
|
|
103
|
+ sleeper()
|
97
|
104
|
|
98
|
105
|
print(f"\n\n Loop complete restarting \n\n")
|
99
|
106
|
|