Untitled
import pyautogui import keyboard import time def interrupt_script(): print("Interrupção detectada. Finalizando o script...") exit() try: while True: if keyboard.is_pressed('esc'): interrupt_script() # Simula ações com pyautogui pyautogui.moveTo(1228, 334, duration=1) for i in range(500): pyautogui.click() pyautogui.click() time.sleep(1) except KeyboardInterrupt: print("Script interrompido.")
Leave a Comment