I’m trying to use KeyboardInterrupt along with other errors but it doesn’t seem to be working. (I have pyautogui and time imported already.)
try:
x, y = pyautogui.locateCenterOnScreen('default.png', confidence=0.6)
pyautogui.click(x, y)
print (x, y)
time.sleep(0.5)
except ImageNotFoundException:
print ("Nope nothing there. Try number:", tries)
time.sleep(1)
except KeyboardInterrupt:
print("Manual shutdown activated...")
time.sleep(1)
break;