Jan-27-2021, 05:43 PM
(Jan-27-2021, 04:25 PM)rachidel07 Wrote:location = pyautogui.locateOnScreen('image.png', confidence = 0.6) while 1: if location:
You check for the file's location one time, when the script starts. If you hide it after starting the script, it won't "forget" where it is, because you never check for it again. If you want to continuously watch for the object, you need to continuously look for the object. Like this:
while True: location = pyautogui.locateOnScreen('image.png', confidence = 0.6) if location: