在4399上找到了“别踩白块儿”网页版小游戏,然后用python3写了一个自动玩的小脚本。使用Python3,OpenCV 3.
import cv2
import numpy as np
import os
import pyscreenshot as ss
import time
def onMouse(event, x, y, flags, param):
global flag, pLeftTop, pRightBottom
if event == cv2.EVENT_LBUTTONDOWN:
if flag:
pLeftTop = (x,y)
else:
pRightBottom = (x,y)
flag = False
flag = Tru