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)