Python whatsapp spam bot5/17/2023 ![]() So lets stop the program for 5 seconds after the input is taken so that we can place the cursor at its right place. Just one thing, this will start typing the message as soon as we put the number and press enter, but ideally we need some time to position the cursor at the right place before the messages start flooding in. import pyautogui msg = input("Enter the message: ") n = input("How many times ?: ") for i in range(0,int(n)): pyautogui.typewrite(msg '\n') ![]() We will ask the user for the message to send, and the number of times it needs to be sent. ![]() We will be using the pyautogui.typewrite(string) function, this will type the string passed in at the current cursor position. To install it, just open your terminal and do pip install pyautogui The PyAutoGUI library provides a lot of functionality to execute key strokes via python. So what we are really trying to build here is a script that automatically executes a lot of key strokes. That’s exactly what we are going to build.
0 Comments
Leave a Reply. |