[Python] How to speed up while loop with PyAutoGui?

Discussão em 'Python' iniciado por Stack, Agosto 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am making a very simple spambot for Discord just for pranking my friends. But the while True: command is very slow. Is there a faster alternative?

    import PIL
    import pyautogui, time
    time.sleep(5)
    pyautogui.FAILSAFE = True
    while True:
    pyautogui.hotkey("command", "v")
    pyautogui.press("enter")

    if (pyautogui.locateOnScreen("av.png")):
    (pyautogui.click(pyautogui.locateCenterOnScreen("av.png")))

    Continue reading...

Compartilhe esta Página