Skip to content

Commit 275b371

Browse files
Update scp_terminal.py
1 parent d565936 commit 275b371

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

scp_terminal.py

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def command_engine(mode):
7575

7676
elif usr == "help":
7777
print("")
78-
print(" ●", Fore.CYAN + "Enter SCP item number :", Fore.LIGHTBLACK_EX + "Displays SCP item information")
79-
print(" ●", Fore.CYAN + "random :", Fore.LIGHTBLACK_EX + "Displays information for a random artifact")
78+
print(" ●", Fore.CYAN + "SCP item number :", Fore.LIGHTBLACK_EX + "Displays SCP item information")
79+
print(" ●", Fore.CYAN + "random :", Fore.LIGHTBLACK_EX + "Displays information for a random SCP item")
8080
print(" ●", Fore.CYAN + "del :", Fore.LIGHTBLACK_EX + "Deletes all SCP files")
8181
print(" ●", Fore.CYAN + "lock :", Fore.LIGHTBLACK_EX + "Emergency lockout protocol")
8282
print(" ●", Fore.CYAN + "incog :", Fore.LIGHTBLACK_EX + "Incognito mode")
@@ -161,7 +161,7 @@ def command_engine(mode):
161161
chronicle_log(f" Accessing SCP-{random_scp} files", mode)
162162
for i in range(101):
163163
progress(i)
164-
time.sleep(0.01)
164+
time.sleep(0.0001)
165165

166166
print()
167167
print(Fore.GREEN + " Access granted")
@@ -203,8 +203,7 @@ def format_paragraph(paragraph, length, left, right):
203203
paragraphs = txt.split('\n\n')
204204

205205
for paragraph in paragraphs:
206-
q = format_paragraph(
207-
paragraph, 80, left=4, right=5)
206+
q = format_paragraph(paragraph, 80, left=4, right=5)
208207
print(q)
209208
print("") # next paragraph
210209

@@ -214,16 +213,20 @@ def format_paragraph(paragraph, length, left, right):
214213
print(Fore.LIGHTBLACK_EX + "File saved locally".center(100))
215214
chronicle_log("<< File saved locally >>".center(100), mode)
216215
print("")
217-
print(Fore.LIGHTBLACK_EX +
218-
"Copyright © 2024 Ashfaaq Rifath".center(100))
216+
print(Fore.LIGHTBLACK_EX +"Copyright © 2024 Ashfaaq Rifath".center(100))
219217

220218
save_path = "SCP object files"
221219
save = os.path.join(save_path, f'SCP-{random_scp}.txt')
222220

221+
date = datetime.datetime.now().strftime("%D:%h:%H:%M:%S")
222+
header = "SCP Foundation Terminal v2.1.5\n" + str(date) + f" \n<< PROPERTY OF THE SCP FOUNDATION >> \nSCP-{random_scp} File >>\n \n"
223+
223224
orig_stdout = sys.stdout
224225
f = open(save, 'w', encoding="utf-8")
225226
sys.stdout = f
226227

228+
print(header)
229+
227230
for i in num_list:
228231
txt = s.find_all('p')[i].text
229232

@@ -252,6 +255,9 @@ def format_paragraph(paragraph, length, left, right):
252255
paragraph, 80, left=4, right=5)
253256
print(q)
254257
print("")
258+
259+
print("<< END OF FILE >>".center(100))
260+
print("Copyright © 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.5".center(100))
255261
sys.stdout = orig_stdout
256262
f.close()
257263

@@ -271,7 +277,7 @@ def format_paragraph(paragraph, length, left, right):
271277
chronicle_log("END LOG >>", mode)
272278
break
273279

274-
elif usr.startswith("scp"):
280+
elif usr.lower().startswith("scp"):
275281
get_num = re.search(r'\d+', usr)
276282

277283
if get_num:
@@ -294,7 +300,7 @@ def format_paragraph(paragraph, length, left, right):
294300
chronicle_log(f" Accessing SCP-{item_num} files", mode)
295301
for i in range(101):
296302
progress(i)
297-
time.sleep(0.01)
303+
time.sleep(0.0001)
298304

299305
print()
300306
print(Fore.GREEN + " Access granted")
@@ -352,10 +358,15 @@ def format_paragraph(paragraph, length, left, right):
352358
save_path = "SCP object files"
353359
save = os.path.join(save_path, f'SCP-{item_num}.txt')
354360

361+
date = datetime.datetime.now().strftime("%D:%h:%H:%M:%S")
362+
header = "SCP Foundation Terminal v2.1.5\n" + str(date) + f" \n<< PROPERTY OF THE SCP FOUNDATION >> \nSCP-{item_num} File >>\n \n"
363+
355364
orig_stdout = sys.stdout
356365
f = open(save, 'w', encoding="utf-8")
357366
sys.stdout = f
358367

368+
print(header)
369+
359370
for i in num_list:
360371
txt = s.find_all('p')[i].text
361372

@@ -385,6 +396,8 @@ def format_paragraph(paragraph, length, left, right):
385396
print(q)
386397
print("")
387398

399+
print("<< END OF FILE >>".center(100))
400+
print("Copyright © 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.5".center(100))
388401
sys.stdout = orig_stdout
389402
f.close()
390403

@@ -407,22 +420,22 @@ def format_paragraph(paragraph, length, left, right):
407420
print("")
408421
print(Fore.YELLOW + " Connecting SCP terminal")
409422

410-
# for i in range(101):
411-
# progress(i)
412-
# time.sleep(0.01)
423+
for i in range(101):
424+
progress(i)
425+
time.sleep(0.0001)
413426

414427
print()
415428
print(Fore.GREEN + " Systems online")
416429
print("")
417430
print(Fore.LIGHTBLACK_EX +
418-
"Copyright © 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.4")
431+
"Copyright © 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.5")
419432
time.sleep(1)
420433
os.system('cls')
421434

422435
incognito = 0
423436

424437
date = datetime.datetime.now().strftime("%D:%h:%H:%M:%S")
425-
chronicle_log(write="SCP Foundation Terminal v2.1.4\n" +
438+
chronicle_log(write="SCP Foundation Terminal v2.1.5\n" +
426439
str(date) + " \n<< ACTIVITY LOG >> \nBEGIN LOG >>\n \n", incog=incognito)
427440

428441
print("")
@@ -433,10 +446,11 @@ def format_paragraph(paragraph, length, left, right):
433446
SECURE ● CONTAIN ● PROTECT''')
434447
print("")
435448
print(" ", Back.RED + " WARNING. THE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED ACCESS IS STRICTLY PROHIBITED ")
436-
#speak("WARNING. THEE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED ACCESS IS STRICTLY PROHIBITED.")
449+
speak("WARNING. THEE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED ACCESS IS STRICTLY PROHIBITED.")
437450
print("")
438451

439452
attempts = 3
453+
o5_code = 0
440454

441455
while attempts > 0:
442456

@@ -476,22 +490,21 @@ def format_paragraph(paragraph, length, left, right):
476490
except FileNotFoundError:
477491
pass
478492

479-
o5_code = 0
480-
481493
if login_pass in p and len(login_pass) == 4 or o5_code == 1:
482494

483-
if o5_code != 1 and login_name != "override":
495+
if login_name == "override" and o5_code != 1:
496+
print(Fore.GREEN + " Override code accepted")
497+
speak("Override code accepted")
498+
499+
if o5_code != 1:
484500
print(" ", Fore.BLACK + Back.GREEN + " ACCESS GRANTED ")
485501
speak("Access granted.")
486502

487-
print("")
488-
print(Fore.GREEN + f" Welcome {login_name}")
489-
speak(f" Welcome {login_name}")
490-
chronicle_log(f" Welcome {login_name}", incognito)
491-
492-
elif login_name == "override":
493-
print(Fore.GREEN + " Override code accepted")
494-
speak("Override code accepted")
503+
if login_name != "override":
504+
print("")
505+
print(Fore.GREEN + f" Welcome {login_name}")
506+
speak(f" Welcome {login_name}")
507+
chronicle_log(f" Welcome {login_name}", incognito)
495508

496509
command_engine(incognito)
497510
break
@@ -514,4 +527,4 @@ def format_paragraph(paragraph, length, left, right):
514527
command_engine(incognito)
515528

516529

517-
# Copyright (c) 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.4
530+
# Copyright (c) 2024 Ashfaaq Rifath - SCP Foundation Terminal v2.1.5

0 commit comments

Comments
 (0)