Skip to content

Commit 2395dda

Browse files
Add files via upload
1 parent f3422ae commit 2395dda

File tree

6 files changed

+668
-0
lines changed

6 files changed

+668
-0
lines changed

lockout.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import time
2+
import os
3+
import colorama
4+
from speech_engine import speak
5+
from colorama import Fore, Back
6+
colorama.init(autoreset=True)
7+
8+
9+
def progress(percent=0, width=30):
10+
symbol = width * percent // 100
11+
blanks = width - symbol
12+
print('\r[ ', Fore.GREEN + symbol * "█", blanks*' ', ' ]', f' {percent:.0f}%', sep='', end='', flush=True)
13+
14+
15+
def lock_protocol():
16+
os.system('cls')
17+
18+
for x in range(9):
19+
print("")
20+
21+
print(Fore.RED + '''
22+
▀▀█▀▀ █▀▀▀ █▀▀█ █▀▄▀█ ▀█▀ █▄ █ █▀▀█ █ █ █▀▀▀█ █▀▀█ █ ▄▀ █▀▀▀ █▀▀▄
23+
█ █▀▀▀ █▄▄▀ █ █ █ █ █ █ █ █▄▄█ █ █ █ █ █ █▀▄ █▀▀▀ █ █
24+
█ █▄▄▄ █ █ █ █ ▄█▄ █ ▀█ █ █ █▄▄█ █▄▄█ █▄▄▄█ █▄▄█ █ █ █▄▄▄ █▄▄▀''')
25+
print("")
26+
print(" ", Back.RED + " <<< EMERGENCY LOCKOUT PROTOCOL INITIATED >>> ")
27+
for y in range(2):
28+
speak("EMERGENCY LOCKOUT PROTOCOL INITIATED")
29+
30+
print("")
31+
me = input(Fore.RED + " Enter O5 authorization code: ")
32+
if me == "200211":
33+
print("")
34+
print(Fore.YELLOW + " Bypassing lockout protocol")
35+
for i in range(101):
36+
progress(i)
37+
time.sleep(0.01)
38+
39+
print()
40+
print(Fore.GREEN + " Lockout protocol disabled")
41+
print("")
42+
print(Fore.GREEN + " O5 authorization code accepted")
43+
speak("lockout protocol disabled")
44+
45+
os.system('cls')
46+
print("")
47+
print(" ", Fore.BLACK + Back.GREEN + " TERMINAL UNLOCKED ")
48+
speak("TERMINAL UNLOCKED")
49+
50+
else:
51+
print("")
52+
print(" ", Fore.BLACK + Back.RED + " INVALID AUTHORIZATION CODE ")
53+
speak("Invalid authorization code")
54+
time.sleep(7200)

override.py

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
import colorama
2+
import requests
3+
from bs4 import BeautifulSoup
4+
import scp001
5+
import register
6+
import time
7+
from speech_engine import speak
8+
from lockout import lock_protocol
9+
import os
10+
import os.path
11+
import shutil
12+
import sys
13+
from colorama import Fore, Back
14+
colorama.init(autoreset=True)
15+
16+
17+
def progress(percent=0, width=30):
18+
symbol = width * percent // 100
19+
blanks = width - symbol
20+
print('\r[ ', Fore.GREEN + symbol * "█", blanks*' ', ' ]',
21+
f' {percent:.0f}%', sep='', end='', flush=True)
22+
23+
24+
print("")
25+
speak("Enter security override code")
26+
override_code = input(Fore.RED + " Enter security override code: ")
27+
if override_code == "rachinter 201":
28+
29+
print("")
30+
print(Fore.YELLOW + " Security override")
31+
for i in range(101):
32+
progress(i)
33+
time.sleep(0.01)
34+
35+
print()
36+
print(Fore.GREEN + " Override code accepted")
37+
speak("Override code accepted")
38+
39+
print("")
40+
print(" ", Fore.BLACK + Back.GREEN + " ACCESS GRANTED ")
41+
speak("Access granted.")
42+
43+
folder = os.path.exists("SCP object files")
44+
if folder == False:
45+
os.mkdir("SCP object files")
46+
elif folder == True:
47+
pass
48+
49+
if __name__ == "__main__":
50+
51+
while(1):
52+
print("")
53+
speak("Enter terminal command")
54+
usr = input(" Enter terminal command: ")
55+
56+
if usr == "001":
57+
scp001.restricted()
58+
59+
elif usr.lower() == "del":
60+
print("")
61+
print(Fore.RED + " ----------------------------")
62+
print(Fore.RED + " INITIATING DELETION PROTOCOL")
63+
print(Fore.RED + " ----------------------------")
64+
speak("initiating deletion protocol")
65+
shutil.rmtree("SCP object files")
66+
time.sleep(1)
67+
print(
68+
Fore.GREEN + " All files related to SCP objects has been deleted.")
69+
speak("All files related to SCP objects has been deleted")
70+
71+
elif usr == "help":
72+
print("")
73+
print(" -----------------------------------------")
74+
print(" |", Fore.CYAN + "Enter SCP item number :", Fore.LIGHTBLACK_EX + "Displays information for a given artifact")
75+
print(" |", Fore.CYAN + "del :", Fore.LIGHTBLACK_EX + "Initiates deletion protocol")
76+
print(" |", Fore.CYAN + "clear :", Fore.LIGHTBLACK_EX + "Clears the output of the terminal")
77+
print(" |", Fore.CYAN + "reg :", Fore.LIGHTBLACK_EX + "Registers new user")
78+
print(" -----------------------------------------")
79+
speak("Displaying terminal instructions.")
80+
time.sleep(3)
81+
82+
elif usr == "lock":
83+
lock_protocol()
84+
85+
elif usr == "reg":
86+
register.usr_register()
87+
88+
elif usr == "clear":
89+
os.system('cls')
90+
speak("terminal output cleared")
91+
92+
else:
93+
r = requests.get(f'https://scp-wiki.wikidot.com/scp-{usr}')
94+
soup = BeautifulSoup(r.content, 'html.parser')
95+
s = soup.find('div', id='page-content')
96+
97+
paras = len(s.find_all("p"))
98+
99+
print("")
100+
print(Fore.YELLOW + f" Accessing SCP-{usr} files")
101+
speak(f"Accessing SCP-{usr} files")
102+
for i in range(101):
103+
progress(i)
104+
time.sleep(0.01)
105+
106+
print()
107+
print(Fore.GREEN + " Access granted")
108+
print("")
109+
110+
print(Fore.GREEN + soup.title.text.center(100))
111+
print("")
112+
113+
paras_num = range(1, paras)
114+
num_list = list(paras_num)
115+
116+
item = f"{s.find_all('p')[0].text}\n"
117+
print(Fore.YELLOW + item.center(100))
118+
119+
try:
120+
for i in num_list:
121+
txt = s.find_all('p')[i].text
122+
123+
def format_paragraph(paragraph, length, left, right):
124+
words = paragraph.split()
125+
lines = []
126+
# we add a space before the first word
127+
curline = ' ' * (left - 1)
128+
129+
while words:
130+
# process the next word
131+
word = words.pop(0)
132+
# +1 in the next line is for the space.
133+
if len(curline) + 1 + len(word) > length - right:
134+
# line would have been too long, start a new line
135+
lines.append(curline)
136+
curline = ' ' * (left - 1)
137+
curline += " " + word
138+
lines.append(curline)
139+
140+
return '\n'.join(lines)
141+
# we need to work on one paragraph at a time
142+
paragraphs = txt.split('\n\n')
143+
144+
for paragraph in paragraphs:
145+
q = format_paragraph(
146+
paragraph, 80, left=4, right=5)
147+
print(q)
148+
print("") # next paragraph
149+
150+
except IndexError:
151+
print(Fore.RED + "<<< END OF FILE >>>".center(100))
152+
print(Fore.RED + "<<< END OF FILE >>>".center(100))
153+
print(Fore.LIGHTBLACK_EX + "File saved locally".center(100))
154+
print("")
155+
print(Fore.LIGHTBLACK_EX +
156+
"Terminal developed by Ashfaaq Rifath".center(100))
157+
158+
save_path = "SCP object files"
159+
save = os.path.join(save_path, f'SCP-{usr}.txt')
160+
161+
orig_stdout = sys.stdout
162+
f = open(save, 'w', encoding="utf-8")
163+
sys.stdout = f
164+
165+
for i in num_list:
166+
txt = s.find_all('p')[i].text
167+
168+
def format_paragraph(paragraph, length, left, right):
169+
words = paragraph.split()
170+
lines = []
171+
# we add a space before the first word
172+
curline = ' ' * (left - 1)
173+
174+
while words:
175+
word = words.pop(0) # process the next word
176+
# +1 in the next line is for the space.
177+
if len(curline) + 1 + len(word) > length - right:
178+
# line would have been too long, start a new line
179+
lines.append(curline)
180+
curline = ' ' * (left - 1)
181+
curline += " " + word
182+
lines.append(curline)
183+
184+
return '\n'.join(lines)
185+
# we need to work on one paragraph at a time
186+
paragraphs = txt.split('\n\n')
187+
188+
for paragraph in paragraphs:
189+
q = format_paragraph(
190+
paragraph, 80, left=4, right=5)
191+
print(q)
192+
print("")
193+
194+
sys.stdout = orig_stdout
195+
f.close()
196+
197+
speak(f"Item number : SCP-{usr}")
198+
199+
sis = s.find_all('p')[2].text
200+
speak(sis)
201+
202+
lines = s.find_all('p')[3]
203+
speak(lines)
204+
205+
else:
206+
print("")
207+
print(" ", Fore.BLACK + Back.RED + " INVALID OVERRIDE CODE ")
208+
speak("INVALID OVERRIDE CODE")
209+
print("")
210+
print(Fore.RED + " <<< TERMINAL LOCKOUT >>>")
211+
time.sleep(7300)
212+
213+
214+
215+
216+
217+
218+
# <<< Copyright (c) 2023 Ashfaaq Rifath - SCP Foundation Terminal v2.1.1 >>>

register.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import sys
2+
from speech_engine import speak
3+
from colorama import Fore, Back
4+
import colorama
5+
colorama.init(autoreset=True)
6+
7+
def usr_register():
8+
print("")
9+
print(Fore.RED + " --------------------------------")
10+
print(Fore.RED + " INITIATING REGISTRATION PROTOCOL")
11+
print(Fore.RED + " --------------------------------")
12+
speak("INITIATING REGISTRATION PROTOCOL")
13+
14+
usr_name = str(input(" Enter username: "))
15+
level = int(input(" Enter clearance level (0 - 5): "))
16+
usr_tile = str(input(" Enter staff title: "))
17+
usr_site = int(input(" Enter working site: "))
18+
usr_pass = input(" Create a password: ")
19+
20+
usrReg = sys.stdout
21+
reg = open(f'{usr_name}.txt', 'w', encoding="utf-8")
22+
sys.stdout = reg
23+
24+
print(f"Name : {usr_name}")
25+
print(f"Clearance level : {level}")
26+
print(f"Staff title : {usr_tile}")
27+
print(f"Working site : {usr_site}")
28+
print(usr_pass, end="")
29+
30+
sys.stdout = usrReg
31+
reg.close()
32+
33+
print("")
34+
print(" ", Fore.BLACK + Back.GREEN + " New user registered ")
35+
print(Fore.GREEN + " You now have access to the foundation database.")
36+
speak("New user registered")
37+
speak("You now have access to the foundation database")

scp001.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import time
2+
import pyttsx3
3+
import colorama
4+
from colorama import Fore, Back
5+
colorama.init(autoreset=True)
6+
7+
8+
def casper_speak(talk):
9+
engine = pyttsx3.init("sapi5")
10+
engine.setProperty('rate', 150)
11+
voices = engine.getProperty('voices')
12+
engine.setProperty('voice', voices[1].id)
13+
engine.say(talk)
14+
engine.runAndWait()
15+
16+
17+
def restricted():
18+
print("")
19+
print(" ", Back.RED + " <<< ACCESS RESTRICTED >>> ")
20+
print(Fore.RED + "--------------------------------------------------------------------------".center(100))
21+
print(Fore.RED + "THIS FILE HAS BEEN CLASSIFIED".center(100))
22+
print(Fore.RED + "<<< TOP SECRET >>>".center(100))
23+
print(Fore.RED + "BY ORDER OF THE ADMINISTRATOR".center(100))
24+
print("")
25+
print(Fore.RED + "ACCESS TO SCP-001 IS RESCRICTED TO O5 COUNCIL MEMBERS ONLY.".center(100))
26+
print(Fore.RED + "--------------------------------------------------------------------------".center(100))
27+
print("")
28+
29+
print(Fore.YELLOW + "GENERAL NOTICE 001-ALPHA:".center(100))
30+
print(Fore.YELLOW + "IN ORDER TO PREVENT KNOWLEDGE OF SCP-001 FROM".center(100))
31+
print(Fore.YELLOW + "BEING LEAKED, SEVERAL/NO FALSE SCP-001 FILES".center(100))
32+
print(Fore.YELLOW + "HAVE BEEN CREATED ALONGSIDE THE TRUE FILE/FILES.".center(100))
33+
print(Fore.YELLOW + "ALL FILES CONCERNING THE NATURE OF SCP-001, INCLUDING".center(100))
34+
print(Fore.YELLOW + "THE DECOY/DECOYS, ARE PROTECTED".center(100))
35+
print(Fore.YELLOW + "BY A MEMETIC KILL AGENT DESIGNED TO IMMEDIATELY".center(100))
36+
print(Fore.YELLOW + "CAUSE CARDIAC ARREST IN ANY NONAUTHORIZED PERSONNEL".center(100))
37+
print(Fore.YELLOW + "ATTEMPTING TO ACCESS THE FILE. REVEALING THE TRUE NATURE/NATURES OF SCP-001".center(100))
38+
print(Fore.YELLOW + "TO THE GENERAL PUBLIC IS CAUSE FOR EXECUTION.".center(100))
39+
print(Fore.YELLOW + "EXCEPT AS REQUIRED UNDER ████-███-██████.".center(100))
40+
print("")
41+
42+
print(Fore.RED + "--------------------------------------------------------------------------".center(100))
43+
print(Fore.RED + "ANY NON-AUTHORIZED PERSONNEL ACCESSING THESE DOCUMENTS WILL BE IMMEDIATELY".center(100))
44+
print(Fore.RED + "TERMINATED THROUGH THE BERRYMAN-LANGFORD MEMETIC KILL AGENT.".center(100))
45+
print(Fore.RED + "--------------------------------------------------------------------------".center(100))
46+
print("")
47+
print(Fore.LIGHTBLACK_EX + "Terminal developed by Ashfaaq Rifath".center(100))
48+
49+
casper_speak("ACCESS DENIED")
50+
casper_speak("ACCESS TO SCP-001 is restricted TO O-five COUNCIL MEMBERS ONLY.")
51+
casper_speak("unauthorized personal access will be terminated through a memetic kill agent.")
52+
casper_speak("this file has been classified as top secret by order of the administrator.")
53+
time.sleep(1)
54+
print("")

0 commit comments

Comments
 (0)