Skip to content

Commit 11c6b5f

Browse files
authored
Add files via upload
1 parent 39a4c43 commit 11c6b5f

File tree

2 files changed

+141
-0
lines changed

2 files changed

+141
-0
lines changed

app.py

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import pyautogui as pg
2+
import time
3+
import keyboard
4+
import os
5+
6+
greeter = """
7+
▄▄▄ █ ██ ▄▄▄█████▓ ▒█████
8+
▒████▄ ██ ▓██▒▓ ██▒ ▓▒▒██▒ ██▒
9+
▒██ ▀█▄ ▓██ ▒██░▒ ▓██░ ▒░▒██░ ██▒
10+
░██▄▄▄▄██ ▓▓█ ░██░░ ▓██▓ ░ ▒██ ██░
11+
▓█ ▓██▒▒▒█████▓ ▒██▒ ░ ░ ████▓▒░
12+
▒▒ ▓▒█░░▒▓▒ ▒ ▒ ▒ ░░ ░ ▒░▒░▒░
13+
▒ ▒▒ ░░░▒░ ░ ░ ░ ░ ▒ ▒░
14+
░ ▒ ░░░ ░ ░ ░ ░ ░ ░ ▒
15+
░ ░ ░ ░ ░
16+
17+
▄▄▄█████▓▓██ ██▓ ██▓███ ██▓ ███▄ █ ▄████
18+
▓ ██▒ ▓▒ ▒██ ██▒▓██░ ██▒▓██▒ ██ ▀█ █ ██▒ ▀█▒
19+
▒ ▓██░ ▒░ ▒██ ██░▓██░ ██▓▒▒██▒▓██ ▀█ ██▒▒██░▄▄▄░
20+
░ ▓██▓ ░ ░ ▐██▓░▒██▄█▓▒ ▒░██░▓██▒ ▐▌██▒░▓█ ██▓
21+
▒██▒ ░ ░ ██▒▓░▒██▒ ░ ░░██░▒██░ ▓██░░▒▓███▀▒
22+
▒ ░░ ██▒▒▒ ▒▓▒░ ░ ░░▓ ░ ▒░ ▒ ▒ ░▒ ▒
23+
░ ▓██ ░▒░ ░▒ ░ ▒ ░░ ░░ ░ ▒░ ░ ░
24+
░ ▒ ▒ ░░ ░░ ▒ ░ ░ ░ ░ ░ ░ ░
25+
░ ░ ░ ░ ░
26+
░ ░
27+
▄▄▄▄ ▓██ ██▓ █ █░ ▒█████ ██▓ █████▒
28+
▓█████▄▒██ ██▒ ▓█░ █ ░█░▒██▒ ██▒▓██▒ ▓██ ▒
29+
▒██▒ ▄██▒█n█ ██░ ▒█░ █ ░█ ▒██░ ██▒▒██░ ▒████ ░
30+
▒██░█▀ ░ ▐██▓░ ░█░ █ ░█ ▒██ ██░▒██░ ░▓█▒ ░
31+
░▓█ ▀█▓░ ██▒▓░ ░░██▒██▓ ░ ████▓▒░░██████▒░▒█░
32+
░▒▓███▀▒ ██▒▒▒ ░ ▓░▒ ▒ ░ ▒░▒░▒░ ░ ▒░▓ ░ ▒ ░
33+
▒░▒ ░▓██ ░▒░ ▒ ░ ░ ░ ▒ ▒░ ░ ░ ▒ ░ ░
34+
░ ░▒ ▒ ░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░
35+
░ ░ ░ ░ ░ ░ ░ ░
36+
░░ ░
37+
"""
38+
print(greeter)
39+
40+
def ReadFile():
41+
42+
file = open('words.txt', 'r')
43+
44+
for line in file:
45+
for word in line.split():
46+
print(word)
47+
48+
def check_user_input(input):
49+
try:
50+
# Convert it into integer
51+
return int(input)
52+
except ValueError:
53+
try:
54+
# Convert it into float
55+
return float(input)
56+
except ValueError:
57+
print("Input is not a number.\nSet for 5 as default.")
58+
return 5
59+
def check_user_input2(input):
60+
try:
61+
if(str(input) == 'y'):
62+
return True
63+
elif(str(input) == 'yes'):
64+
return True
65+
else:
66+
return False
67+
except ValueError:
68+
print("Input is not a Boolean.\nSet for true as default.")
69+
return True
70+
def option_1(num, text, timeout, PressEnter):
71+
import time
72+
print('Starting after 5 seconds.\nHold (esc) to cancel!')
73+
if keyboard.is_pressed("esc"):
74+
i = num
75+
print("ended.")
76+
time.sleep(5)
77+
78+
i = 0
79+
while i != num:
80+
if keyboard.is_pressed("esc"):
81+
i = num
82+
print("ended.")
83+
break
84+
i = i+1
85+
pg.press('Enter')
86+
pg.write(str(text))
87+
pg.press('Enter')
88+
time.sleep(timeout)
89+
print(str(i) + ' Done')
90+
def option_2(timeout, texts):
91+
import time
92+
print('Starting after 5 seconds.\nHold (esc) to cancel!')
93+
time.sleep(5)
94+
95+
for text in texts:
96+
if keyboard.is_pressed("esc"):
97+
print("ended.")
98+
break
99+
pg.write(str(text))
100+
pg.press('Enter')
101+
time.sleep(timeout)
102+
print(str(text) + ' Done!')
103+
104+
try:
105+
options = input("\nHello {UserName},\nOptions:\n[1] Add one sentence that will be auto send\n[2] Add different sentence that will be auto send\nType the option number to start.\n".format(UserName=os.environ["username"]))
106+
except EOFError:
107+
option = 5
108+
print('Input is EOF exception, please enter something and run me again')
109+
exit()
110+
except KeyboardInterrupt:
111+
option = 5
112+
print('You have pressed ctrl-c button.')
113+
exit()
114+
115+
options = check_user_input(options)
116+
117+
if options == 1:
118+
Num = input("How many times do you want to send the text?\n")
119+
Num = check_user_input(Num)
120+
text = input("Please type the text to send.\n")
121+
Timeout = input("Please type the time in seconds between every text. (0 for no timeout)\n")
122+
Timeout = check_user_input(Timeout)
123+
PressEnter = input("Do you want to use Enter(y/n)?(This option will let the code press enter before and after writing a text!)\n")
124+
check_user_input2(PressEnter)
125+
option_1(Num, text, Timeout, PressEnter)
126+
elif options == 2:
127+
Num = input("How much texts do you want to send?\n")
128+
Num = check_user_input(Num)
129+
Timeout = input("Please type the time in seconds between every text. (0 for no timeout)\n")
130+
Timeout = check_user_input(Timeout)
131+
Texts = []
132+
i = 0
133+
while len(Texts) != Num:
134+
i = i+1
135+
text = input("Type text number ({i}):\n".format(i=i))
136+
Texts.append(text)
137+
option_2(Timeout, Texts)
138+
else:
139+
print("Unknown input please try again later!")
140+
141+
pg.alert(text='The program ended', title='Done', button='Ok')

words.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)