Skip to content

Instantly share code, notes, and snippets.

@ccrsxx
Last active March 31, 2022 02:54
Show Gist options
  • Save ccrsxx/1151e5b26643a56693fd145803d590e1 to your computer and use it in GitHub Desktop.
Save ccrsxx/1151e5b26643a56693fd145803d590e1 to your computer and use it in GitHub Desktop.
import pyautogui
import time
import os
def cls():
os.system('cls')
print(f'{" Spam chat - by Risal ":*^30}\n')
def spam(text: str, many: int):
again = False
cls()
print('Place the cursor in the chat box!\n')
try:
for i in range(5, 0, -1):
print(f'Spam will start in {i} second', end='\r')
time.sleep(1)
cls()
print('Spamming in progress... CTRL + C to cancel!')
for _ in range(many):
pyautogui.write(f'{text}\n')
except KeyboardInterrupt:
cls()
print('User interrupt the program, exiting...')
quit()
cls()
print(f'{many} spam sent successfully!')
try:
while again not in ['Y', 'y', 'N', 'n']:
again = input('Want to spam again (Y/n)?\n> ')
if again in ['Y', 'y']:
main()
elif again in ['N', 'n']:
quit()
else:
cls()
print('Not a valid input, please enter Y/n!\n')
except KeyboardInterrupt:
cls()
print('User interrupt the program, exiting...')
quit()
def main():
cls()
text, many = False, 0
try:
while not many:
text = input('What is the text of the spam?\n> ')
if not text:
cls()
print('Must not be an empty string!\n')
continue
print()
many = input('How much spam do you want to sent?\n> ')
if not many.isnumeric() or int(many) < 1:
cls()
print('Not a valid number, must be an int and more than 0!\n')
many = 0
except KeyboardInterrupt:
cls()
print('User interrupt the program, exiting...')
quit()
spam(text, int(many))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment