asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.51k stars 1.27k forks source link

pyautogui LocateOnScreen #312

Open Asp3cTy opened 5 years ago

Asp3cTy commented 5 years ago

I am doing an automator to open my League of Legends and already put my login and password, until then everything working. I wanted to know how do I use LocateOnScreen to click only when it appears to accept the queue to enter the match. Queue time is different all the time, you do not know the exact moment that the button will appear to accept, how do I click only when the button appears? SORRY MY ENGLISH!

sarthikb commented 5 years ago

write a loop to locate image and click when locateOnScreen return something(In failed cases it'll return None).