while pyautogui.locateOnScreen('white4x4.png', region = (200,200,4,4)) != None:
playsound('click.mp3')
if pyautogui.locateOnScreen('white4x4.png', region = (200,200,4,4)) == None:
continue
pyautogui takes a screenshot and checks whether my image is in certain region or not, I want it to keep repeating
playsound('click.mp3')
when the image is visible, but when its not I want it to keep checking (repeating pyautogui.locateOnScreen) if the image is visible again . So far my code ends when I hide the image, I dont know how to keep it as "Standby".
Also, Im having a very hard time understanding the continue function, does it go back and read while again and again?
EDIT
I also tried this
while pyautogui.locateOnScreen('white4x4.png', region = (200,200,4,4)) is not None:
playsound('click.mp3')
else:
continue
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…