Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import keyboard as key
- import pyautogui
- import keyboard
- import time
- import random
- def checkButton():
- buttonlocation = pyautogui.locateOnScreen('button.png')
- if buttonlocation is None:
- pass
- else:
- print('is found')
- buttonx, buttony = pyautogui.locateCenterOnScreen('button.png')
- pyautogui.click(buttonx,buttony)
- time.sleep(0.2)
- pyautogui.click(buttonx,buttony)
- print('x:' + str(buttonx) + ' y:' + str(buttony))
- while True:
- checkButton()
Advertisement
Add Comment
Please, Sign In to add comment