Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creddits
- --AIO for makeing OS
- --IAN for help
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear()
- print("Loading","/","pagh'a' DuSaQ","/","Laden","/","sekisai")
- while true do
- shell.run("cd ..")
- if fs.isDriveRoot("") then
- break
- end
- sleep(0)
- end
- DIR = "/"
- function DrawLargeBoxSimple(DrawX,DrawY,Height)
- TEMP = term.getBackgroundColor()
- term.setBackgroundColor(colors.black)
- for i=DrawY,Height do
- term.setCursorPos(DrawX,i)
- term.clearLine()
- sleep(0)
- end
- term.setCursorPos(DrawX,DrawY)
- term.setBackgroundColor(TEMP)
- end
- function DrawFolder(Folder)
- term.setBackgroundColor(colors.black)
- if term.isColor() then
- if multishell.getCount() > 1 then
- DrawLargeBoxSimple(1,1,13)
- else
- DrawLargeBoxSimple(1,2,13)
- end
- else
- DrawLargeBoxSimple(1,2,13)
- end
- TEMP = fs.list(Folder)
- T = 0
- for i=1,#TEMP do
- sleep(0)
- for j=1,10 do
- T = T + 1
- if #TEMP < T then
- break
- else
- term.setCursorPos(((i*10)-9),j+1)
- if fs.isDir(TEMP[T]) then
- term.setTextColor(colors.yellow)
- if fs.isReadOnly(TEMP[T]) then
- term.setTextColor(colors.red)
- end
- else
- term.setTextColor(colors.blue)
- end
- print(T,TEMP[T])
- end
- sleep(0)
- end
- end
- end
- function DrawDesktop()
- WinW,WinH = term.getSize()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1,WinH)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- if term.isColor() then
- Processes = {}
- for i=1,multishell.getCount() do
- Processes[i] = multishell.getTitle(i)
- sleep(0)
- end
- else
- Processes = {"OS8"}
- end
- term.clearLine()
- print("OS8",Lang_Press_Ctrl_For_Prompt,"","",Lang_ProcessCount,":",#Processes)
- print(Lang_Press_F2_For_Setup,"","",os.date())
- end
- --DEFINE LANGUAGE CODES HERE
- --Linux
- function LoadLinux()
- Lang_Press_Ctrl_For_Prompt = "sudo apt install lolcat && sudo echo 'Press F1 For ctrl+shift+T' | lolcat"
- Lang_ProcessCount = "htop"
- Lang_Hi = "sudo wall 'Hello, World!'"
- Lang_Sel = "echo 'selection'"
- Lang_Lang = "neofetch"
- Lang_CURR = "GNU/LINUX"
- Lang_keyboard = "neofetch | lolcat"
- Lang_setting = "--help"
- Lang_manual = "arch"
- Lang_smart = "-y"
- Lang_name = "whoami"
- Lang_to = "cd"
- Lang_welcome = "sudo apt install lolcat -y && sudo apt install neofetch -y | lolcat && sudo wall 'welcome' | lolcat && sudo neofetch | lolcat && sudo apt purge neofetch | lolcat && sudo apt purge lolcat | lolcat && rm -rf && echo 'i make usless scripts BTW' && logout"
- Lang_Press_F2_For_Setup = "flatpak install F2 | lolcat && nano /bin/bash"
- end
- --C {As seen by Ian}
- function LoadC()
- Lang_Press_Ctrl_For_Prompt = "int main(F1) {terminal()}"
- Lang_ProcessCount = "int main(this.threads) {get.threads()}"
- Lang_Hi = "#include < stdio.h > int main() {printf(''Hello, World!'')}"
- Lang_Sel = "#include < stdio.h > int main() {printf(''Selection'')}"
- Lang_Lang = "#include < studio.h > int main() {printf(''Language'')}"
- Lang_CURR = "C"
- Lang_keyboard = "#include < i/o > int main() {return 0;}"
- Lang_setting = "int main() {char = variable; variable = ''settings''}"
- Lang_manual = "gcc manual.c"
- Lang_smart = "gcc C++.c"
- Lang_name = "int main() {char name;}"
- Lang_to = "int main() {int var; char pointer[10];}"
- Lang_welcome = "int main() {return 0;}"
- Lang_Press_F2_For_Setup = "gcc OS8.c;//F2"
- end
- --Morse (lazy ascii internet standard)
- function LoadMorse()
- Lang_Press_Ctrl_For_Prompt = ".--. .-. . ... ... / ..-. .---- / ..-. --- .-. / -.-. -- -.."
- Lang_ProcessCount = ".--. .-. --- -.-. . ... ... . ..."
- Lang_Hi = ".... .."
- Lang_Sel = "... . .-.."
- Lang_Lang = ".-.. .- -. --. ..- .- --. ."
- Lang_CURR = "-- --- .-. ... . / -.-. --- -.. ."
- Lang_keyboard = "-.- . -.--"
- Lang_setting = "... . - - .. -. --."
- Lang_manual = "... .. -. --. .-.. . / -.- . -.--"
- Lang_smart = "... -- .- .-. -"
- Lang_name = "--.- .-. .-"
- Lang_to = "-.. ."
- Lang_welcome = ".-- . .-.. -.-. --- -- ."
- Lang_Press_F2_For_setup = ".--. .-. . ... ... / .----. ..-. ..--- .----. / ..-. --- .-. / ... . - ..- .--."
- end
- --Swedish
- function LoadSwedish()
- LoadEnglish()
- Lang_Press_Ctrl_For_Prompt = "Tryck på 'F1' för kommandotolken"
- Lang_ProcessCount = "Processer"
- Lang_Hi = "Tjenixen"
- Lang_Sel = "val"
- Lang_Lang = "språk"
- Lang_CURR = "SVENSKA"
- Lang_keyboard = "tangentbord"
- Lang_setting = "instälning"
- Lang_manual = "manual"
- Lang_smart = "smart"
- Lang_name = "namn"
- Lang_to = "till"
- Lang_welcome = "Välkommen"
- Lang_Press_F2_For_Setup = "Tryck på 'F2' för configurations menyn"
- end
- --Klingon (Latin)
- function LoadKlingon()
- LoadEnglish()
- Lang_Press_Ctrl_For_Prompt = "che'wI' lojmIthom veSDuj"
- Lang_ProcessCount = "mIw"
- Lang_Hi = "nuqneH"
- Lang_Sel = "ghuy'cha'"
- Lang_Lang = "Hol"
- Lang_CURR = "tlhIngan"
- Lang_keyboard = "qardar"
- Lang_setting = "'aw'"
- Lang_manual = "matlh"
- Lang_smart = "val"
- Lang_name = "pong"
- Lang_to = "ngeH"
- Lang_welcome = "yI'el"
- Lang_Press_F2_For_Setup = "chep ''veSDujmeymaj yIloS."
- end
- --German
- function LoadGerman()
- LoadEnglish()
- Lang_Press_Ctrl_For_Prompt = "Drücken Sie 'F1' für die Eingabeaufforderung"
- Lang_ProcessCount = "Abläufe"
- Lang_Hi = "Hallo"
- Lang_Sel = "Auswahl"
- Lang_Lang = "Sprache"
- Lang_CURR = "DEUTSCH"
- Lang_keyboard = "Tastatur"
- Lang_setting = "Einstellung"
- Lang_manual = "Manuell"
- Lang_smart = "klug"
- Lang_name = "Name"
- Lang_to = "bei"
- Lang_welcome = "Willkommen"
- Lang_Press_F2_For_Setup = "Drücken Sie 'F2' für die Einrichtung"
- end
- --Japanise (Romanisation)
- function LoadJapanise()
- LoadEnglish()
- Lang_Press_Ctrl_For_Prompt = "command prompt no tame ni '' F1 '' wo oshi te kudasai"
- Lang_ProcessCount = "proces"
- Lang_Hi = "Kon'nichiwa"
- Lang_Sel = "sentei"
- Lang_Lang = "gengo"
- Lang_CURR = "nihon ka"
- Lang_keyboard = "keyboard"
- Lang_setting = "settei"
- Lang_manual = "shudo"
- Lang_smart = "kashirai"
- Lang_name = "namae"
- Lang_to = "atesaki"
- Lang_welcome = "yokosou"
- Lang_Press_F2_For_Setup = "yokosou setup no tame ni 'f2' wo oshi masu"
- end
- --English
- function LoadEnglish()
- Lang_Press_Ctrl_For_Prompt = "Press 'F1' for command prompt"
- Lang_ProcessCount = "Processes"
- Lang_Hi = "Hello"
- Lang_Sel = "Selection"
- Lang_Lang = "Language"
- Lang_CURR = "ENGLISH"
- Lang_keyboard = "keyboard"
- Lang_setting = "setting"
- Lang_manual = "manual"
- Lang_smart = "smart"
- Lang_name = "name"
- Lang_to = "to"
- Lang_welcome = "welcome"
- Lang_Press_F2_For_Setup = "Press F2 for setup"
- end
- CTRL_KEY = 128
- function Setup()
- if fs.exists("./OS") then
- else
- shell.run("mkdir ./OS")
- shell.run("ls")
- shell.run("ls ./")
- shell.run("ls ./OS")
- sleep(1)
- end
- --LANG
- while true do
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- LoadEnglish()
- print("1 = ",Lang_CURR)
- LoadKlingon()
- print("2 = ",Lang_CURR)
- LoadGerman()
- print("3 = ",Lang_CURR)
- LoadJapanise()
- print("4 = ",Lang_CURR)
- LoadSwedish()
- print("5 = ",Lang_CURR)
- LoadMorse()
- print("6 = ",Lang_CURR)
- LoadC()
- print("7 = ",Lang_CURR)
- LoadLinux()
- print("8 = ",Lang_CURR)
- LoadEnglish()
- if fs.exists("./OS/lang") then
- H = fs.open("./OS/lang","r")
- lang = H.readLine()
- H.close()
- if lang == "ENG" then
- LoadEnglish()
- print(Lang_CURR)
- elseif lang == "KLI" then
- LoadKlingon()
- print(Lang_CURR)
- elseif lang == "GER" then
- LoadGerman()
- print(Lang_CURR)
- elseif lang == "JAP" then
- LoadJapanise()
- print(Lang_CURR)
- elseif lang == "SWE" then
- LoadSwedish()
- print(Lang_CURR)
- elseif lang == "C" then
- LoadC()
- print(Lang_CURR)
- elseif lang == "MORSE" then
- LoadMorse()
- print(Lang_CURR)
- elseif lang == "GNU" then
- LoadLinux()
- print(Lang_CURR)
- end
- end
- print(Lang_Sel)
- INP = string.upper(read())
- H = fs.open("./OS/lang","w")
- if INP == "1" then
- LoadEnglish()
- H.write("ENG")
- break
- elseif INP == "2" then
- LoadKlingon()
- H.write("KLI")
- break
- elseif INP == "3" then
- LoadGerman()
- H.write("GER")
- break
- elseif INP == "4" then
- LoadJapanise()
- H.write("JAP")
- break
- elseif INP == "5" then
- LoadSwedish()
- H.write("SWE")
- break
- elseif INP == "6" then
- LoadMorse()
- H.write("MORSE")
- break
- elseif INP == "7" then
- LoadC()
- H.write("C")
- break
- elseif INP == "8" then
- LoadLinux()
- H.write("GNU")
- break
- end
- end
- H.close()
- --KEYBOARD
- term.clear()
- term.setCursorPos(1,1)
- print(Lang_keyboard)
- print(Lang_keyboard,Lang_setting,Lang_Sel)
- print(keys.q,keys.w,keys.e,keys.r,keys.t,keys.y)
- sleep(2)
- --USRN
- term.clear()
- term.setCursorPos(1,1)
- print(Lang_name)
- USRN = read()
- H = fs.open("./OS/USRN","w")
- H.write(USRN)
- H.close()
- --FIN
- term.clear()
- term.setCursorPos(1,1)
- print(Lang_Lang,Lang_CURR)
- print(Lang_keyboard,keys.q)
- print(Lang_name,USRN)
- sleep(3)
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- print(Lang_Hi)
- print(Lang_welcome,Lang_to,"OS8",USRN)
- end
- function start()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setTextColor(colors.blue)
- term.setCursorPos(1,1)
- print("|")
- H = fs.open("./OS/lang","r")
- lang = H.readLine()
- H.close()
- sleep(0.1)
- term.setCursorPos(1,1)
- print("-")
- if lang == "ENG" then
- LoadEnglish()
- elseif lang == "JAP" then
- LoadJapanise()
- elseif lang == "GER" then
- LoadGerman()
- elseif lang == "KLI" then
- LoadKlingon()
- elseif lang == "SWE" then
- LoadSwedish()
- elseif lang == "MORSE" then
- LoadMorse()
- elseif lang == "C" then
- LoadC()
- elseif lang == "GNU" then
- LoadLinux()
- else
- LoadEnglish()
- end
- print(Lang_Lang,":",Lang_CURR)
- term.setCursorPos(1,1)
- sleep(0.1)
- print("|")
- H = fs.open("./OS/USRN","r")
- USRN = H.read()
- H.close()
- sleep(0.1)
- term.setCursorPos(1,1)
- print("-")
- print(Lang_name,USRN)
- sleep(0.1)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear()
- --SHOWTIME!
- PopUp(Lang_welcome,USRN)
- sleep(1)
- while true do
- sleep(0)
- DrawDesktop()
- DrawFolder("")
- files = fs.list("")
- E,K = os.pullEvent("key")
- if K == keys.f2 then
- shell.run("rm ./OS/USRN")
- sleep(1)
- shell.run("OS8")
- end
- if K == keys.f1 then
- if term.isColor() then
- shell.run("fg")
- else
- return "quit"
- end
- elseif K == keys.one and #files+1 > 1 then
- if fs.isDir(files[1]) then
- DrawFolder(files[1])
- else
- shell.run(files[1])
- end
- elseif K == keys.two and #files+1 > 2 then
- if fs.isDir(files[2]) then
- DrawFolder(files[2])
- else
- shell.run(files[2])
- end
- elseif K == keys.three and #files+1 > 3 then
- if fs.isDir(files[3]) then
- DrawFolder(files[3])
- else
- shell.run(files[3])
- end
- elseif K == keys.four and #files+1 > 4 then
- if fs.isDir(files[4]) then
- DrawFolder(files[4])
- else
- shell.run(files[4])
- end
- elseif K == keys.five and #files+1 > 5 then
- if fs.isDir(files[5]) then
- DrawFolder(files[5])
- else
- shell.run(files[5])
- end
- elseif K == keys.six and #files+1 > 6 then
- if fs.isDir(files[6]) then
- DrawFolder(files[6])
- else
- shell.run(files[6])
- end
- elseif K == keys.seven and #files+1 > 7 then
- if fs.isDir(files[7]) then
- DrawFolder(files[7])
- else
- shell.run(files[7])
- end
- elseif K == keys.eight and #files+1 > 8 then
- if fs.isDir(files[8]) then
- DrawFolder(files[8])
- else
- shell.run(files[8])
- end
- elseif K == keys.nine and #files+1 > 9 then
- if fs.isDir(files[9]) then
- DrawFolder(files[9])
- else
- shell.run(files[9])
- end
- elseif K == keys.zero and #files+1 > 0 then
- if fs.isDir(files[10]) then
- DrawFolder(files[10])
- else
- shell.run(files[10])
- end
- end
- sleep(2)
- end
- end
- function PopUp(title,text)
- if string.len(title) > string.len(text) then
- TEMP = title
- else
- TEMP = text
- end
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.white)
- print(string.rep(" ",string.len(TEMP)))
- print(string.rep(" ",string.len(TEMP)))
- term.setCursorPos(1,1)
- print(title)
- print(text)
- end
- if fs.exists("./OS/lang") and fs.exists("./OS/USRN") then
- start()
- else
- Setup()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement