Browse Source

added game counter

Neccor 4 years ago
parent
commit
b2925749f5
1 changed files with 36 additions and 7 deletions
  1. 36
    7
      main.py

+ 36
- 7
main.py View File

@@ -26,7 +26,7 @@ def sleeper():
26 26
 	return
27 27
 
28 28
 
29
-def loop(runde):
29
+def loose_loop(loose_rounds):
30 30
 	while True:
31 31
 		sleeper()
32 32
 		pyautogui.screenshot("screenshot.png")
@@ -37,8 +37,8 @@ def loop(runde):
37 37
 		v_continue = False
38 38
 		v_ready = False
39 39
 
40
-		runde += 1
41
-		print(runde)
40
+		loose_rounds += 1
41
+		print(loose_rounds)
42 42
 
43 43
 		# Options
44 44
 
@@ -125,9 +125,38 @@ def loop(runde):
125 125
 				print(f"Ready nicht gefunden")
126 126
 				sleeper()
127 127
 
128
-		print(f"\n\n Loop complete restarting \nRunde {runde} absolviert\n\n")
128
+		print(f"\n\n Loop complete restarting \nRunde {loose_rounds} absolviert\n\n")
129 129
 
130
-runde = 0
130
+		if loose_rounds >= 30:
131
+			print(f"{loose_rounds} Spiele absolviert\nWechsle Modus")
131 132
 
132
-while True:
133
-	loop(runde)
133
+
134
+def win_loop(win_rounds):
135
+	while True:
136
+		time.sleep(1)
137
+
138
+		while v_continue == False or v_ready == False:
139
+			time.sleep(1)
140
+			pyautogui.screenshot("screenshot.png")
141
+			f_continue = find_image("continue.png")
142
+			f_ready = find_image("ready.png")
143
+			if f_continue != None:
144
+				pyautogui.click((f_continue[0], f_continue[1]))
145
+			elif f_ready != None:
146
+				pyautogui.click((f_ready[0], f_ready[1]))
147
+				win_rounds += 1
148
+				print(f"Siege: {win_rounds}")
149
+			else:
150
+				print(f"Kein Ergebniss gefunden")
151
+				time.sleep(1)
152
+
153
+
154
+# Siege
155
+win_rounds = 0
156
+while win_rounds >= 30:
157
+	win_loop(win_rounds)
158
+
159
+# Niederlage
160
+loose_rounds = 0
161
+while loose_rounds >= 30:
162
+	loose_loop(loose_rounds)

Loading…
Cancel
Save