import pyautogui
import cv2
def kinsure(x):
pyautogui.screenshot('filename.png')
img = cv2.imread("filename.png", 0)
temp = cv2.imread(x, 0)
result = cv2.matchTemplate(img, temp, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)
if max_val >= 0.95:
pyautogui.click(max_loc)
pyautogui.FAILSAFE = True
pyautogui.PAUSE = 0.3
while 1:
print("あ")
pyautogui.screenshot('filename.png') #BAN1 マリアかローレインを押す 選択を押す
img = cv2.imread("filename.png", 0)
temp = cv2.imread("BAN1.png", 0)
result = cv2.matchTemplate(img, temp, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)
if max_val >= 0.95:
kinsure("ローレインBAN.png")
kinsure("マリアBAN.png")
kinsure("選択.png")
pyautogui.screenshot('filename.png') #英雄選択 ユノ リリア ミリアンヌ ジェーン クラウス ラウディア ライアス グレンウィス の順番 選択を押す
img = cv2.imread("filename.png", 0)
temp = cv2.imread("参加する英雄を.png", 0)
result = cv2.matchTemplate(img, temp, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)
if max_val >= 0.95:
kinsure("グレンウィス.png")
kinsure("ライアス.png")
kinsure("ラウディア.png")
kinsure("クラウス.png")
kinsure("ジェーン.png")
kinsure("ミリアンヌ.png")
kinsure("リリア.png")
kinsure("ユノ.png")
kinsure("選択.png")
pyautogui.screenshot('filename.png') #BAN2
img = cv2.imread("filename.png", 0)
temp = cv2.imread("BAN2.png", 0)
result = cv2.matchTemplate(img, temp, cv2.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(result)
if max_val >= 0.95:
pyautogui.click(1800, 600)
kinsure("選択.png")
kinsure("45ポイント.png")
kinsure("リトライ.png")
kinsure("リトライ.png")
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
00