Error in pyhon, pyautogui

0

I created a bot (macro) which has the function of making a few clicks on X time. I made the loop for this.

def afkLoop(): #Loop
    pycontrol.broken() #Função
    time.sleep(1800) #Timer
    afkLoop() 

def broken(): #Função
    print "["+(str(time.strftime("%H:%M:%S")))+"] Done.."

    pyautogui.click(104,14) #Aba 01
    time.sleep(3)
    pyautogui.press("up")
    pyautogui.press("down")

    time.sleep(3)    
    pyautogui.click(297,17) #Aba 02
    time.sleep(3)
    pyautogui.press("up")
    pyautogui.press("down")

    time.sleep(3)    
    pyautogui.click(475,11) #Aba 03
    time.sleep(3)
    pyautogui.press("up")
    pyautogui.press("down")

    time.sleep(3)    
    pyautogui.click(659,16) #Aba 04
    time.sleep(3)
    pyautogui.press("up")
    pyautogui.press("down")

The problem is that for some hours, the program closes, I got the error: pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to upper-left corner. To disable this fail-safe, set pyautogui.FAILSAFE to False.

How can I solve it? I'm using python 2.7 and pyautogui.

    
asked by anonymous 26.10.2017 / 00:51

1 answer

0

As a security feature, a protection feature is enabled by default. When the PyAutoGUI functions increase, if the mouse cursor is in the upper left corner of the screen. If you lose control and need to stop the current PyAutoGUI function, continue moving the mouse cursor up and to the left. To disable this feature, set to:

pyautogui.FAILSAFE = False 

Learn more at link

    
26.10.2017 / 01:07