LoginSignup
0
0

More than 5 years have passed since last update.

ガチャマクロ

Last updated at Posted at 2019-03-31
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 = 2

while 1:
    kinsure("test.png")

kinsure("画像の名前")でその画像の左上のマスを何秒かごとにクリックしてくれる

クリックしたいボタンのこんな感じのスクリーンショットを切り抜くといい
test.png.png

while文の中を書き換えて自分だけのマクロを作ろう!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0