-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alpha.py
389 lines (272 loc) · 13.2 KB
/
Alpha.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# all the imports
# import getpass # for entering the password
import sys # for typing effect
from os import system, name # for clearing screen
from time import sleep # for showing output for some time period
# from subprocess import call # import call method from subprocess module
# from pynput import keyboard # for the keyboard shortcuts
import signal
# import os
import subprocess
import random
def handler(signum, frame):
print('You didn\'t say the magic word'), signum
# -------------------------------- pip installed? ------------------------------------------
# ------------------------------------installs-----------------------------------
# ----------Not needed, just tell the end user to install the packages ------------------------
# pip install pynput
# def install(package):
# subprocess.check_call([sys.executable, "-m", "pip", "install", package])
# ------------------------------------lists----------------------------------------------
greetings_as_intentions = [
'hi', 'hello', 'hey', 'hola', 'hey there', "heylo"
]
goodbyes_as_intentions = [
'bye', 'see ya', 'see you', 'see you later', 'goodbye'
]
ai_qn_as_intentions = [
'who are you?', 'who are you', 'are you human', 'are you human?'
]
# ------------------------------------------------- FUNCTIONS -------------------------------------------------
# define our clear function
def clear():
print("\n")
# for windows
if name == 'nt':
_ = system('cls')
# for mac and linux(here, os.name is 'posix')
else:
_ = system('clear')
def sleep_clear():
sleep(1.5)
clear()
# def pass_input():
# typing_effect_ideal("Enter your password. Keep in mind that your password won't be visible on your screen as you type it")
# password = getpass.getpass("Password = ")
def typing_effect_really_fast(texts):
for char in texts:
sleep(0.003)
sys.stdout.write(char)
sys.stdout.flush()
print("")
def typing_effect_really_slow(texts):
for char in texts:
sleep(0.3)
sys.stdout.write(char)
sys.stdout.flush()
print("")
def typing_effect_ideal(texts):
for char in texts:
sleep(0.019)
sys.stdout.write(char)
sys.stdout.flush()
print("")
def typing_effect_really_fast_line(texts):
for char in texts:
sleep(0.003)
sys.stdout.write(char)
sys.stdout.flush()
def typing_effect_really_slow_line(texts):
for char in texts:
sleep(0.3)
sys.stdout.write(char)
sys.stdout.flush()
def typing_effect_ideal_line(texts):
for char in texts:
sleep(0.019)
sys.stdout.write(char)
sys.stdout.flush()
# Keyboard shortcut things begin
# The currently active modifiers
# current = set()
# # The key combination to check
# COMBINATIONS = [
# {keyboard.Key.shift, keyboard.KeyCode(char='a')},
# {keyboard.Key.shift, keyboard.KeyCode(char='A')}
# ]
# # The currently active modifiers
# current = set()
# def execute():
# print ("Do Something")
# def on_press(key):
# if any([key in COMBO for COMBO in COMBINATIONS]):
# current.add(key)
# if any(all(k in current for k in COMBO) for COMBO in COMBINATIONS):
# execute()
# def on_release(key):
# if any([key in COMBO for COMBO in COMBINATIONS]):
# current.remove(key)
# with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
# listener.join()
def name_input():
name = ''
say_name = ['Gotta spill it dude', 'C\'mon say it', 'You can\'t see the rest without it',
'Why so serious?', 'Just say it', 'imma call you princess otherwise', 'You don\'t get it do you?', "What\'s holding you back?", ':/'] # Random things to say if no name is given
while True:
try:
typing_effect_ideal("What's your name?")
name = input('Name = ')
print('')
except ValueError:
typing_effect_ideal('Say what now?')
sleep_clear()
if name in ['', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']:
say_this = random.choice(say_name) # Generating a random thing
typing_effect_ideal(say_this)
sleep_clear()
continue
else:
break
typing_effect_ideal_line("You call yourself ")
typing_effect_ideal(name)
sleep_clear()
typing_effect_ideal("Noice")
sleep_clear()
def alpha():
typing_effect_really_fast(r"""
$$$$$$\ $$\ $$$$$$\ $$\ $$\
$$ __$$\ $$ | $$ __$$\ $$ | $$ |
$$ / \__| $$$$$$\ $$$$$$$ | $$$$$$\ $$ / $$ |$$ | $$$$$$\ $$$$$$$\ $$$$$$\
$$ | $$ __$$\ $$ __$$ |$$ __$$\ $$$$$$$$ |$$ |$$ __$$\ $$ __$$\ \____$$\
$$ | $$ / $$ |$$ / $$ |$$$$$$$$ | $$ __$$ |$$ |$$ / $$ |$$ | $$ | $$$$$$$ |
$$ | $$\ $$ | $$ |$$ | $$ |$$ ____| $$ | $$ |$$ |$$ | $$ |$$ | $$ |$$ __$$ |
\$$$$$$ |\$$$$$$ |\$$$$$$$ |\$$$$$$$\ $$ | $$ |$$ |$$$$$$$ |$$ | $$ |\$$$$$$$ |
\______/ \______/ \_______| \_______| \__| \__|\__|$$ ____/ \__| \__| \_______|
$$ |
$$ |
\__|
""")
typing_effect_really_fast(r"""
$$\
\__|
$$$$$$$\ $$$$$$\ $$\ $$\ $$\ $$$$$$\ $$\ $$\$$$$$$$\ $$$$$$$\ $$\$$$$$$$\ $$$$$$\
$$ __$$\$$ __$$\$$ | $$ | $$ | $$ __$$\$$ | $$ $$ __$$\$$ __$$\$$ $$ __$$\$$ __$$\
$$ | $$ $$ / $$ $$ | $$ | $$ | $$ | \__$$ | $$ $$ | $$ $$ | $$ $$ $$ | $$ $$ / $$ |
$$ | $$ $$ | $$ $$ | $$ | $$ | $$ | $$ | $$ $$ | $$ $$ | $$ $$ $$ | $$ $$ | $$ |
$$ | $$ \$$$$$$ \$$$$$\$$$$ | $$ | \$$$$$$ $$ | $$ $$ | $$ $$ $$ | $$ \$$$$$$$ |
\__| \__|\______/ \_____\____/ \__| \______/\__| \__\__| \__\__\__| \__|\____$$ |
$$\ $$ |
\$$$$$$ |
\______/
""")
sleep_clear()
typing_effect_really_fast(r"""
$$$$$$$\ $$\ $$\
$$ __$$\$$ | $$ |
$$ | $$ $$ |$$$$$$$\ $$$$$$$\$$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$\ $$\ $$\ $$\
$$$$$$$ $$ $$ _____| $$ _____\_$$ _| $$ __$$\$$ __$$\ $$ __$$\$$ __$$\$$ | $$ | $$ |
$$ ____/$$ \$$$$$$\ \$$$$$$\ $$ | $$ / $$ $$ / $$ | $$ | $$ $$ / $$ $$ | $$ | $$ |
$$ | $$ |\____$$\ \____$$\ $$ |$$\$$ | $$ $$ | $$ | $$ | $$ $$ | $$ $$ | $$ | $$ |
$$ | $$ $$$$$$$ | $$$$$$$ | \$$$$ \$$$$$$ $$$$$$$ | $$ | $$ \$$$$$$ \$$$$$\$$$$ |
\__| \__\_______/ \_______/ \____/ \______/$$ ____/ \__| \__|\______/ \_____\____/
$$ |
$$ |
\__|
""")
sleep_clear()
typing_effect_really_fast(r"""
$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\ $$\$$\$$\
$$ __$$\ $$ | $$ | $$ __$$\ $$ | $$ | \__$$ $$ |
$$ / \__$$$$$$\ $$$$$$\ $$ | $$ / \__| $$$$$$\ $$$$$$\ $$ | $$\$$\$$ $$ | $$$$$$\$$$$\ $$$$$$\
$$ | \_$$ _| $$ __$$\$$ $$$$$$\$$ | \_$$ _| $$ __$$\ $$ | $$ $$ $$ $$ | $$ _$$ _$$\$$ __$$\
$$ | $$ | $$ | \__$$ \______$$ | $$ | $$ / $$ | $$$$$$ /$$ $$ $$ | $$ / $$ / $$ $$$$$$$$ |
$$ | $$\ $$ |$$\$$ | $$ | $$ | $$\ $$ |$$\$$ | $$ | $$ _$$< $$ $$ $$ | $$ | $$ | $$ $$ ____|
\$$$$$$ | \$$$$ $$ | $$ | \$$$$$$ | \$$$$ \$$$$$$ | $$ | \$$\$$ $$ $$ | $$ | $$ | $$ \$$$$$$$\
\______/ \____/\__| \__| \______/ \____/ \______/ \__| \__\__\__\__| \__| \__| \__|\_______|
""")
sleep_clear()
sleep(3)
typing_effect_really_fast(r"""
$$$$$$\ $$$$$$\ $$\
$$ ___$$\ $$ __$$\ $$$$ |
\_/ $$ | \__/ $$ | \_$$ |
$$$$$ / $$$$$$ | $$ |
\___$$\ $$ ____/ $$ |
$$\ $$ | $$ | $$ |
\$$$$$$ $$\$$\$$\$$\$$\$$\$$\$$$$$$$$\$$\$$\$$\$$\$$\$$\$$\$$$$$$\$$\$$\$$\$$\$$\
\______/\__\__\__\__\__\__\__\________\__\__\__\__\__\__\__\______\__\__\__\__\__|
""")
sleep_clear()
typing_effect_really_fast(r"""
$$$$$$\ $$\ $$\ $$\ $$\
$$ __$$\$$ | \__| $$ | $$ |
$$ / $$ $$ |$$$$$$\ $$\ $$$$$$\ $$$$$$$\$$$$$$\
$$$$$$$$ $$ $$ __$$\$$ $$ __$$\$$ __$$\_$$ _|
$$ __$$ $$ $$ | \__$$ $$ / $$ $$ | $$ |$$ |
$$ | $$ $$ $$ | $$ $$ | $$ $$ | $$ |$$ |$$\
$$ | $$ $$ $$ | $$ \$$$$$$$ $$ | $$ |\$$$$ |
\__| \__\__\__| \__|\____$$ \__| \__| \____/
$$\ $$ |
\$$$$$$ |
\______/ """)
# ----------------------- ACTUAL PROGRAM ---------------------------------
clear()
alpha()
sleep_clear()
typing_effect_ideal("Hello")
sleep_clear()
typing_effect_ideal(
"Just keep in mind that I'm just a stupid piece of code and I AM NOT as smart as you")
sleep_clear()
typing_effect_ideal("Yeah, I meant it")
sleep_clear()
typing_effect_ideal("And just so that we are clear, please use proper grammar")
sleep_clear()
name_input()
# pass_input()
# just providing a separator for fun
typing_effect_really_fast(r"""
$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\$$$$$$\
\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______\______|""")
print("\n")
typing_effect_ideal("Hello another random user")
print("\n")
typing_effect_ideal(
"Please don't be fooled by my initial courteous language, I can get very annoying, as you saw with all the typing effects")
sleep_clear()
typing_effect_really_fast("I can go really fast like this")
sleep_clear()
typing_effect_really_slow("and really slow like this")
sleep_clear()
typing_effect_ideal("Or as slow at it gets, but I think you get the idea")
sleep_clear()
typing_effect_ideal(
"So if you aren't ready for this, kill me now before you start regretting it")
sleep_clear()
typing_effect_really_slow("3......2.........1......")
# Set the signal handler
signal.signal(signal.SIGINT, handler)
sleep_clear()
typing_effect_ideal(
"So just keep in mind that if I type really slow, it's just to annoy you")
sleep_clear()
typing_effect_ideal("Feeling annoyed yet :)")
print("")
typing_effect_ideal(
"The guy who wrote this sure got annoyed by all the slow typing while debugging this :/ ")
sleep_clear()
typing_effect_ideal("May I ask what are you doing here?")
the_reason = input("--> ")
sleep_clear()
typing_effect_ideal("Why'd I ask? Just to make conversation ")
sleep_clear()
typing_effect_ideal_line("Now this is why you came here ? -----> ")
# typing_effect_ideal_line("\"")
typing_effect_ideal(the_reason)
# typing_effect_ideal_line("\"")
sleep_clear()
typing_effect_really_slow("Duh")
sleep_clear()
typing_effect_ideal("Now lets cut to the chase")
sleep_clear()
typing_effect_ideal("What are you really here for?")
real_intention = input("--->")
#typing_effect_ideal_line("Now this is why you came here for real ? -----> ")
# typing_effect_ideal_line("\"")
# typing_effect_ideal(real_intention)
# typing_effect_ideal_line("\"")
if real_intention in greetings_as_intentions:
typing_effect_ideal("How you doin'?")
else:
if real_intention in goodbyes_as_intentions:
typing_effect_ideal("See ya later")