-
Notifications
You must be signed in to change notification settings - Fork 0
/
automessagesender.py
91 lines (87 loc) · 3.14 KB
/
automessagesender.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class message_typer():
def __init__(self):
import os; os.system("clear || cls")
print("""
█╬█ ██ ██ ██ ███ ███ ██ ╬╬ ███ █╬█ ███ ██ ███
█V█ █▄ █▄ █▄ █▄█ █╬▄ █▄ ╬╬ ╬█╬ █▄█ █▄█ █▄ █▄╬
█╬█ █▄ ▄█ ▄█ █╬█ █▄█ █▄ ╬╬ ╬█╬ ╬█╬ █╬╬ █▄ █╬█
""")
def take_message_nomessage_input(self) -> vars:
print("Enter message :")
message = input()
print("Enter numbers of message to sent :")
no_message = int(input())
print("Add message number with message OR not | 0 for False and 1 for True :")
index = int(input())
return no_message ,message ,index
def auto_message(self ,message : str ,no_messages : int ,send_delay : int ,index : int) -> None :
"""This funstions will type type {message} {no_messages}"""
import time
import pyautogui as pag
# For safety
print(" ")
print("Waiting for 3 second")
time.sleep(1)
print("1s")
time.sleep(2)
print("2s")
time.sleep(3)
print("3s")
# Start measuring time
print(" ")
print("Message Started to send :")
if index == 0 :
start = time.time()
for i in range(no_messages):
pag.write(f"{message}")
pag.press("enter")
time.sleep(send_delay)
print(i+1 , end=" , ")
# Print time taken by program
print(" ")
print("Time taken to send messages :")
print(f"{time.time()-start}s")
print(" ")
elif index == 1 :
start = time.time()
for i in range(no_messages):
pag.write(f"{i+1}. {message}")
pag.press("enter")
time.sleep(send_delay)
print(i+1 , end=" , ")
# Print time taken by program
print(" ")
print("Time taken to send messages :")
print(" ")
if (time.time()-start) < 60 :
print(f"{time.time()-start} seconds")
else:
print(f"{ (time.time()-start)/60 } minutes")
def main():
classobject = message_typer()
no_message ,message ,index =classobject.take_message_nomessage_input()
#
send_delay = input("Enter message send delay (Default is 0) : ")
#
if send_delay =="":
send_delay = 0
else:
send_delay = int(send_delay)
print("")
print(f"Send Delay: {send_delay} seconds")
print(f"Message: {message}")
print(f"No. of messages : {no_message}")
print(f"Index : {index}")
print("")
classobject.auto_message( message ,no_message ,send_delay,index)
#
print("---------Done--------")
print(" ")
if __name__ == '__main__' :
while True:
try :
main()
except Exception as error :
print(error)
print("HELP : index 0 for False or index 1 for true ")
input("Press ENTER to continue")