AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Discord python text spammer11/14/2022 Okay, so we added a simple countdown for our convenience, So … import pyautogui import time msg = input("Enter the message: ") n = input("How many times ? : ") print("t minus") count = 5 while(count != 0): print(count) time.sleep(1) count -= 1 print("Fire in the hole!!!") for i in range(0,int(n)): pyautogui.typewrite(msg '\n') You know what ?, it would be nice if it actually shows how many seconds are left before it starts. Time.sleep(5) will pause the program for 5 seconds before the spam attack starts. import pyautogui import time msg = input("Enter the message: ") n = input("How many times ?: ") time.sleep(5) for i in range(0,int(n)): pyautogui.typewrite(msg '\n') 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.
0 Comments
Read More
Leave a Reply. |