-
Notifications
You must be signed in to change notification settings - Fork 0
/
spam.py
46 lines (39 loc) · 1.1 KB
/
spam.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from operator import is_not
import pyautogui as pag
method=input('read from (f)ile, spam (n)umbers or enter a (c)ustom msg? ')
def check_method(method):
if method!='f' and method!='c' and method!='n':
print('please, enter a correct method!')
method=input('read from (f)ile, spam (n)umbers or enter a (c)ustom msg? ')
check_method(method)
else:
pass
check_method(method)
number=int(input('how many times? '))
def sleep_timer():
for i in range(5):
print(f'starting after {5-i}s...')
pag.sleep(1)
def spam_from_file(number):
f=open('spamtext.txt','r')
msg=f.read()
for i in range(number):
pag.typewrite(msg+'\n')
f.close()
def spam_number(number):
while number!=0:
pag.typewrite(str(number)+'\n')
number-=1
def spam_text(text, number):
for i in range(number):
pag.typewrite(text+'\n')
if method=='f':
sleep_timer()
spam_from_file(number)
elif method=='c':
msg=input('enter your msg: ')
sleep_timer()
spam_text(msg, number)
elif method=='n':
sleep_timer()
spam_number(number)