Neccor 4 years ago
parent
commit
a4532d4a15
4 changed files with 28 additions and 3 deletions
  1. BIN
      assets/gegenki.png
  2. BIN
      assets/options.png
  3. BIN
      assets/play.png
  4. 28
    3
      main.py

BIN
assets/gegenki.png View File


BIN
assets/options.png View File


BIN
assets/play.png View File


+ 28
- 3
main.py View File

@@ -26,7 +26,7 @@ def sleeper():
26 26
 	return
27 27
 
28 28
 
29
-def loop():
29
+def loop(runde):
30 30
 	while True:
31 31
 		sleeper()
32 32
 		pyautogui.screenshot("screenshot.png")
@@ -37,8 +37,12 @@ def loop():
37 37
 		v_continue = False
38 38
 		v_ready = False
39 39
 
40
+		runde += 1
41
+		print(runde)
42
+
40 43
 		# Options
41 44
 
45
+		v_options_counter = 0
42 46
 		while v_options == False:
43 47
 			sleeper()
44 48
 			pyautogui.screenshot("screenshot.png")
@@ -46,12 +50,16 @@ def loop():
46 50
 			if options != None:
47 51
 				v_options = True
48 52
 				pyautogui.click((options[0], options[1]))
53
+			elif v_options_counter >= 10:
54
+				v_options = True
55
+				print(f"Skip options")
49 56
 			else:
50 57
 				print(f"Zahnräder nicht gefunden")
51 58
 				sleeper()
52 59
 
53 60
 		# Surrender
54 61
 
62
+		v_surrender_counter = 0
55 63
 		while v_surrender == False:
56 64
 			sleeper()
57 65
 			pyautogui.screenshot("screenshot.png")
@@ -59,12 +67,16 @@ def loop():
59 67
 			if surrender != None:
60 68
 				v_surrender = True
61 69
 				pyautogui.click((surrender[0], surrender[1]))
70
+			elif v_surrender_counter >= 10:
71
+				v_surrender = True
72
+				print(f"Skip options")
62 73
 			else:
63 74
 				print(f"Surrender nicht gefunden")
64 75
 				sleeper()
65 76
 
66 77
 		# OK
67 78
 
79
+		v_ok_counter = 0
68 80
 		while v_ok == False:
69 81
 			sleeper()
70 82
 			pyautogui.screenshot("screenshot.png")
@@ -72,12 +84,16 @@ def loop():
72 84
 			if ok != None:
73 85
 				v_ok = True
74 86
 				pyautogui.click((ok[0], ok[1]))
87
+			elif v_ok_counter >= 10:
88
+				v_ok = True
89
+				print(f"Skip options")
75 90
 			else:
76 91
 				print(f"OK nicht gefunden")
77 92
 				sleeper()
78 93
 
79 94
 		# Continue
80 95
 
96
+		v_continue_counter = 0
81 97
 		while v_continue == False:
82 98
 			sleeper()
83 99
 			pyautogui.screenshot("screenshot.png")
@@ -85,12 +101,16 @@ def loop():
85 101
 			if f_continue != None:
86 102
 				v_continue = True
87 103
 				pyautogui.click((f_continue[0], f_continue[1]))
104
+			elif v_continue_counter >= 10:
105
+				v_continue = True
106
+				print(f"Skip options")
88 107
 			else:
89 108
 				print(f"Continue nicht gefunden")
90 109
 				sleeper()
91 110
 
92 111
 		# Ready
93 112
 
113
+		v_ready_counter = 0
94 114
 		while v_ready == False:
95 115
 			sleeper()
96 116
 			pyautogui.screenshot("screenshot.png")
@@ -98,11 +118,16 @@ def loop():
98 118
 			if ready != None:
99 119
 				v_ready = True
100 120
 				pyautogui.click((ready[0], ready[1]))
121
+			elif v_ready_counter >= 10:
122
+				v_ready = True
123
+				print(f"Skip options")
101 124
 			else:
102 125
 				print(f"Ready nicht gefunden")
103 126
 				sleeper()
104 127
 
105
-		print(f"\n\n Loop complete restarting \n\n")
128
+		print(f"\n\n Loop complete restarting \nRunde {runde} absolviert\n\n")
129
+
130
+runde = 0
106 131
 
107 132
 while True:
108
-	loop()
133
+	loop(runde)

Loading…
Cancel
Save