2025年3月3日 星期一

dino autoplay II

 import pyautogui

pyautogui.click(100,100)                           

pyautogui.press('space')

c = 0

while True:

    im = pyautogui.screenshot()

    for x in range(250,260,3):

        hasJump = False

        for y in range(230,250  ,3):

            (tr,tg,tb) = im.getpixel((x,y))

            if tr<200:

                c+=1

                print(c,'(',tr,tg,tb,')','(',x,y,')')

                pyautogui.press('space')

                hasJump = True

        if hasJump :

            break

沒有留言:

張貼留言