Neccor 4 years ago
parent
commit
59db631ae7
9 changed files with 69 additions and 11 deletions
  1. 1
    1
      .gitignore
  2. BIN
      assets/assistduel.png
  3. BIN
      assets/mark.png
  4. BIN
      assets/next.png
  5. BIN
      assets/ok.png
  6. BIN
      assets/rndclick.png
  7. 68
    10
      main.py
  8. BIN
      screenshots/Assists Duel.png
  9. BIN
      screenshots/Auto Duel.png

+ 1
- 1
.gitignore View File

@@ -1,7 +1,7 @@
1 1
 # ---> Python
2 2
 # Custom
3 3
 screenshots/
4
-
4
+screenshot.png
5 5
 
6 6
 # Byte-compiled / optimized / DLL files
7 7
 __pycache__/

BIN
assets/assistduel.png View File


BIN
assets/mark.png View File


BIN
assets/next.png View File


BIN
assets/ok.png View File


BIN
assets/rndclick.png View File


+ 68
- 10
main.py View File

@@ -1,16 +1,74 @@
1 1
 import cv2
2
+import time
3
+import pyautogui
2 4
 
3
-# template = cv2.imread("assets/{}.png".format(image), 0)
5
+def findt(image):
6
+	print(f"\n{image} |")
7
+	template = cv2.imread("assets/{}".format(image), 0)
8
+	width, height = template.shape[::-1]
9
+	pyautogui.screenshot("screenshot.png")
10
+	screen = cv2.imread("screenshot.png", 0)
11
+	width2, height2 = screen.shape[::-1]
12
+	match = cv2.matchTemplate(screen, template, cv2.TM_CCOEFF_NORMED)
13
+	value, location = cv2.minMaxLoc(match)[1], cv2.minMaxLoc(match)[3]
14
+	if (value >= 0.8):
15
+		return (location[0], location[1], width, height, value)
16
+	else:
17
+		return None
4 18
 
19
+while True:
20
+	# Start
5 21
 
6
-template = cv2.imread("assets/autoduel.png", 0)
7
-width, height = template.shape[::-1]
8
-print(width)
9
-print(height)
22
+	# True Test
23
+	TT = find("assistduel.png")
24
+	pyautogui.click((TT[0], TT[1]))
25
+	time.sleep(3)
10 26
 
27
+	# Assist Duel
28
+	Assist = find("assistduel.png")
29
+	pyautogui.click((Assist[0], Assist[1]))
30
+	time.sleep(3)
11 31
 
12
-screen = cv2.imread("screenshots/Auto Duel.png", 0)
13
-match = cv2.matchTemplate(screen, template, cv2.TM_CCOEFF_NORMED)
14
-value, location = cv2.minMaxLoc(match)[1], cv2.minMaxLoc(match)[3]
15
-print(value)
16
-print(location)
32
+	Rndclick = find("rndclick.png")
33
+	pyautogui.click((Rndclick[0], Rndclick[1]))
34
+	time.sleep(3)
35
+
36
+	# Auto-Duel
37
+	autoduel = find("autoduel.png")
38
+	pyautogui.click((autoduel[0], autoduel[1]))
39
+	time.sleep(3)
40
+
41
+	# Result
42
+	result = find("ok.png")
43
+	pyautogui.click((result[0], result[1]))
44
+	time.sleep(3)
45
+
46
+	# Duel Result
47
+	duelresult = find("ok.png")
48
+	pyautogui.click((duelresult[0], duelresult[1]))
49
+	time.sleep(3)
50
+
51
+	# Event Points Obtained
52
+	EPO = find("ok.png")
53
+	pyautogui.click((EPO[0], EPO[1]))
54
+	time.sleep(3)
55
+
56
+	# Rescue Complete
57
+	RC = find("mark.png")
58
+	pyautogui.click((RC[0], RC[1]))
59
+	time.sleep(3)
60
+
61
+	# Assisting Players
62
+	AP = find("next.png")
63
+	pyautogui.click((AP[0], AP[1]))
64
+	time.sleep(3)
65
+
66
+	# Treasure Boxes Obtained
67
+	TBO = find("ok.png")
68
+	pyautogui.click((TBO[0], TBO[1]))
69
+	time.sleep(3)
70
+
71
+	# Lootboxen
72
+	LB = find("next.png")
73
+	pyautogui.click((LB[0], LB[1]))
74
+	time.sleep(3)

BIN
screenshots/Assists Duel.png View File


BIN
screenshots/Auto Duel.png View File


Loading…
Cancel
Save