OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to speed up while loop with PyAutoGui?

  • Thread starter Thread starter Vrakyax
  • Start date Start date
V

Vrakyax

Guest
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?

Code:
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")))
<p>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?</p>
<pre class="lang-py prettyprint-override"><code>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")))
</code></pre>
 

Latest posts

Top