python 智能玩别踩白块

 

# encoding :utf-8
import pyautogui
from PIL import Image
import time

pyautogui.FAILSAFE = True

time.sleep(2)
while (True):
region=(646,446,320,10)
im = pyautogui.screenshot(region= region)
im.save("tes1t.png")

for i in range(40,300,80):
px=im.getpixel((i,5))
print(i)
if px[0] == 1:
pyautogui.click(region[0] + i , region[1] + 5)

 

posted @ 2019-11-06 21:50  码小农的幸福生活  阅读(594)  评论(0编辑  收藏  举报