Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- function pi(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("enter a pastebin code or enter exit to exit")
- term.setCursorPos(3,5)
- pcode = read()
- if pcode == "exit" then
- ag(eid,t)
- end
- term.setCursorPos(3,7)
- print("enter a name for this code or enter exit to exit")
- term.setCursorPos(3,9)
- ncode = read()
- if ncode == "exit" then
- ag(eid,t)
- end
- scmd = "pastebin get "..pcode.." /LUAOS/C/Programs/"..ncode
- shell.run(scmd)
- sleep(1)
- ag(eid,t)
- end
- function pl(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawFilledBox(1,1,51,3,colors.blue)
- paintutils.drawLine(2,2,50,2,colors.lightBlue)
- paintutils.drawLine(1,19,51,19,colors.blue)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("LUAOS App Library")
- local x1,y1 = 48,1
- local x2,y2 = 25,1
- local x3,y3 = 35,1
- local choice1 = "Exit"
- local choice2 = "Refresh"
- local choice3 = "Run"
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setCursorPos(x2,y2)
- write(choice2)
- term.setCursorPos(x3,y3)
- write(choice3)
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- ag(eid,t)
- break
- else if cx >= x2 and cx < x2 + choice2:len() and cy == y2 and button == 1 then
- dir = "LUAOS/C/Programs/"
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(1,4)
- local filelist = fs.list(dir)
- for _, file in ipairs(filelist) do
- print(file)
- end
- else if cx >= x3 and cx < x3 + choice3:len() and cy == y3 and button == 1 then
- term.setCursorPos(2,2)
- term.setBackgroundColor(colors.lightBlue)
- print("File:")
- term.setCursorPos(7,2)
- run = read()
- frun = "/LUAOS/C/Programs/"..run
- if not fs.exists(frun) then
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(2,3)
- print("program does not exist")
- sleep(3)
- pl(eid,t)
- break
- end
- shell.openTab(frun)
- pl(eid,t)
- end
- end
- end
- end
- end
- end
- function ad(app,eid,t)
- term.clear()
- if app == "network_manager" then
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawLine(1,1,51,1,colors.blue)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("Download : "..app)
- local x1, y1 = 48,1
- local x2, y2 = 44,19
- local choice1 = "Exit"
- local choice2 = "Download"
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(1,3)
- print("Network Manager:")
- term.setCursorPos(1,5)
- print("Can be used to control a network of computers with an ender/wireless modem on top (NOTE:The modem must be on top of the computer otherwise this wont work). Can be used with server manager to create a network for a building or bigger")
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setBackgroundColor(colors.red)
- term.setCursorPos(x2,y2)
- write(choice2)
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- as(eid,t)
- else if cx >= x2 and cx < x2 + choice2:len() and cy == y1 and button == 1 then
- -- add download here
- end
- end
- end
- end
- else if app == "red_alert" then
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawLine(1,1,51,1,colors.blue)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("Download : "..app)
- local x1, y1 = 48,1
- local x2, y2 = 44,19
- local choice1 = "Exit"
- local choice2 = "Download"
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(1,3)
- print("Red Alert:")
- term.setCursorPos(1,5)
- print("Used to control redstone with a wireless network (NOTE : put an ender/wireless modem on top for it to work)")
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setBackgroundColor(colors.red)
- term.setCursorPos(x2,y2)
- write(choice2)
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- as(eid,t)
- else if cx >= x2 and cx < x2 + choice2:len() and cy == y2 and button == 1 then
- shell.run("pastebin get 5MacHzW9 /LUAOS/C/Programs/red_alert_installer")
- term.setCursorPos(1,49)
- print("red_alert Installed")
- as(eid,t)
- end
- end
- end
- end
- end
- end
- end
- function as(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawLine(1,1,51,1,colors.blue)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("LUAOS App Store")
- local choice1 = "Exit"
- local choice2 = "Download"
- local x1, y1 = 48,1
- local x2, y2 = 44,2
- local x3, y3 = 44,3
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setBackgroundColor(colors.red)
- term.setCursorPos(x2,y2)
- write(choice2)
- term.setCursorPos(x3,y3)
- write(choice2)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(1,2)
- print("Network Manager:Manages Networks")
- term.setCursorPos(1,3)
- print("Red Alert:Manages Redstone")
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- ag(eid,t)
- break
- else if cx >= x2 and cx < x2 + choice2:len() and cy == y2 and button == 1 then
- ad("network_manager",eid,t)
- break
- else if cx >= x3 and cx < x3 + choice3:len() and cy == y3 and button == 1 then
- ad("red_alert",eid,t)
- break
- end
- end
- end
- end
- end
- end
- function ag(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- if not fs.exists("/LUAOS/C/Programs") then
- term.setCursorPos(3,3)
- print("The LUAOS games and apps program is not")
- term.setCursorPos(3,4)
- print("installed ,do you want to install it now")
- term.setCursorPos(3,6)
- print("Y/N")
- local sevemt, param = os.pullEvent("key")
- if param == 21 then
- term.setCursorPos(3,8)
- print("installing now")
- fs.makeDir("/LUAOS/C/Programs")
- term.setCursorPos(3,10)
- print("installed")
- sleep(5)
- ag(eid,t)
- else if param == 49 then
- li(eid,t)
- else
- ag(eid,t)
- end
- end
- end
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Select the option you with to choose")
- choice1 = " App Store "
- choice2 = " Exit "
- choice3 = " Program Library "
- choice4 = " Pastebin Installer "
- local x1, y1 = 3,5
- local x2, y2 = 3,7
- local x3, y3 = 3,9
- local x4, y4 = 3,11
- term.setBackgroundColor(colors.red)
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setCursorPos(x2,y2)
- write(choice2)
- term.setCursorPos(x3,y3)
- write(choice3)
- term.setCursorPos(x4,y4)
- write(choice4)
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- as(eid,t)
- break
- else if cx >= x2 and cx < x2 + choice2:len() and cy == y2 and button == 1 then
- li(eid,t)
- break
- else if cx >= x3 and cx < x3 + choice3:len() and cy == y3 and button == 1 then
- pl(eid,t)
- break
- else if cx >= x4 and cx < x4 + choice4:len() and cy == y4 and button == 1 then
- pi(eid,t)
- break
- end
- end
- end
- end
- end
- end
- end
- function ac1(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Please type an ID to create or type exit")
- term.setCursorPos(3,5)
- print("ID:")
- term.setCursorPos(6,5)
- nid = read()
- if nid == "exit" then
- ac(eid,t)
- end
- term.setCursorPos(3,7)
- fs.makeDir("/LUAOS/S/Users/"..nid)
- term.setCursorPos(3,9)
- print("Now type a username and password")
- term.setCursorPos(3,11)
- print("Username:")
- term.setCursorPos(12,11)
- nu = read()
- term.setCursorPos(3,13)
- print("Password:")
- term.setCursorPos(12,13)
- np = read()
- eu = nid.."user"
- ep = nid.."pass"
- nu = enc.encrypt(nu,eu)
- np = enc.encrypt(np,ep)
- f = fs.open("/LUAOS/S/Users/"..nid.."/u","w")
- f.write(nu)
- f.close()
- f = fs.open("/LUAOS/S/Users/"..nid.."/p","w")
- f.write(np)
- f.close()
- term.setCursorPos(3,15)
- print("finally time to enter the user's")
- term.setCursorPos(3,16)
- print("level of permission (a / n)")
- term.setCursorPos(3,18)
- print("Permission level:")
- term.setCursorPos(20,18)
- nt = read()
- if not nt == "a" and not nt == "n" then
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("invalid permission level")
- sleep(5)
- ac(eid,t)
- end
- et = nid.."perm"
- nt = enc.encrypt(nt,et)
- f= fs.open("/LUAOS/S/Users/"..nid.."/t","w")
- f.write(nt)
- f.close()
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Account created")
- sleep(5)
- ac(eid,t)
- end
- function ac2(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("enter an ID to delete")
- term.setCursorPos(3,5)
- print("ID:")
- term.setCursorPos(6,5)
- did = read()
- did1 = "/LUAOS/S/Users/"..did
- if not fs.exists(did1) then
- term.setCursorPos(3,7)
- print("Invalid ID")
- sleep(5)
- ac(eid,t)
- end
- fs.delete(did1)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Account deleted")
- sleep(5)
- ac(eid,t)
- end
- function fb(dir,eid,t)
- term.setTextColor(colors.red)
- print("directory:",dir)
- print("type a command")
- cmd = read()
- if cmd == "cd" then
- print("enter a directory to go to")
- ed = read()
- ede = dir.."/"..ed
- if not fs.exists(ede) then
- print("directory not found")
- fb(dir,eid,t)
- else if ed == "/" then
- dir = "/"
- fb(dir,eid,t)
- else if dir == "/" then
- dir = "/"..ed
- fb(dir,eid,t)
- end
- end
- end
- dir = ede
- fb(dir,eid,t)
- else if cmd == "ls" then
- local filelist = fs.list(dir)
- for _, file in ipairs(filelist) do
- print(file)
- end
- fb(dir,eid,t)
- else if cmd == "exit" then
- li(eid,t)
- else if cmd == "run" then
- print("enter a program directory to run")
- run = read()
- rune = dir..run
- if rune == "" then
- print("invalid program")
- fb(dir,eid,t)
- end
- shell.openTab(rune)
- else if cmd == "help" then
- print("help guide:")
- print("cd: This command moves your directory to what you enter, if you enter '/' then it will put you at the directory /LUAOS")
- print("ls: This command will tell you all the files in your current directory")
- print("exit: This command will make you exit back to the LUAOS menu")
- print("run: This command will run any program in your current directory that you type as long as it is real")
- print("help: This command will bring up this help guide")
- print("move: This command will move an entered file in the current directory to an entered directory")
- print("delete: This command will delete an entered file in the current directory")
- fb(eid,t)
- else if cmd == "move" then
- print("enter the file to move in your current directory")
- file = read()
- filee = dir.."/"..file
- if not fs.exists(filee) then
- print("file does not exist")
- fb(dir,eid,t)
- end
- print("enter the directory to move the file to (must be a full directory e.g /LUAOS/C/Programs/)")
- fmd = read()
- if not fs.exists(fmd) then
- print("directory does not exist")
- fb(dir,eid,t)
- end
- fs.move(filee,fmd)
- fb(dir,eid,t)
- else if cmd == "delete" then
- print("enter the file in the current directory to delete")
- fdel = read()
- fdele = dir.."/"..fdele
- if not fs.exists(fdele) then
- print("file does not exist")
- fb(dir,eid,t)
- end
- if fdele == "/LUAOS" or fdele == "/LUAOS/S" or fdele == "/LUAOS/S/Users" or fdele == "/LUAOS/S/Users/1" or fdele == "/LUAOS/C" then
- print("access denied")
- fb(dir,eid,t)
- end
- else if cmd == "edit" then
- print("enter a file in your current directory to edit")
- fe = read()
- scmd = "edit "..dir..fe
- shell.run(scmd)
- fb(dir,eid,t)
- else
- print("invalid command. Type 'help' to see all the commands")
- fb(dir,eid,t)
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function ac(eid,t)
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColour(colors.lightBlue)
- local x1, y1 = 3,5
- local x2, y2 = 3,7
- local x3, y3 = 3,9
- local choice1 = " Add Account "
- local choice2 = " Delete Account "
- local choice3 = " Exit "
- term.setCursorPos(3,3)
- print("Welcome to LUAOS account control")
- term.setBackgroundColor(colors.red)
- term.setCursorPos(x1,y1)
- write(choice1)
- term.setCursorPos(x2,y2)
- write(choice2)
- term.setCursorPos(x3,y3)
- write(choice3)
- while true do
- local event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx >= x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 then
- term.clear()
- ac1(eid,t)
- break
- end
- if cx >= x2 and cx < x2 + choice2:len() and cy == y2 and button == 1 then
- term.clear()
- ac2(eid,t)
- break
- end
- if cx >= x3 and cx < x1 + choice3:len() and cy == y3 and button == 1 then
- term.clear()
- li(eid,t)
- break
- end
- end
- end
- end
- function ud(v,eid,t)
- shell.run("pastebin get AC6USdEP version")
- term.clear()
- term.setCursorPos(3,3)
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- f = fs.open("/version", "r")
- v = 0.5
- nv = tonumber(f.readAll())
- f.close()
- term.clear()
- term.setCursorPos(3,3)
- print("LUAOS version:"..v)
- print("the newest version of LUAOS is:"..nv)
- sleep(3)
- if nv > v then
- u = true
- else
- u = false
- end
- if u == true then
- term.setCursorPos(3,5)
- print("updating now")
- shell.run("pastebin get WnjNK63g version1")
- f = fs.open("/version1", "r")
- pb = f.readAll()
- f.close()
- shell.run("pastebin get ", pb, " LUAOSinstall")
- dofile("/LUAOSinstall")
- else
- print("your version of LUAOS is up to date")
- fs.delete("/version")
- if fs.exists("/version1") then
- fs.delete("/version1")
- end
- sleep(5)
- li(eid, t)
- end
- end
- function li(eid,t)
- term.setTextColor(colors.white)
- f1 = fs.open("/LUAOS/S/Temp/eid","r")
- f2 = fs.open("/LUAOS/S/Temp/t","r")
- eid = f1.readAll()
- t = f2.readAll()
- f1.close()
- f2.close()
- eid = enc.decrypt(eid,"teid")
- t = enc.decrypt(t,"tt")
- ma = "n"
- term.clear()
- if fs.exists("/LUAOS/S/Users/"..tonumber(eid).."/db.pic") then
- local db = paintutils.loadImage("/LUAOS/S/Users/"..tonumber(eid).."/db.pic")
- paintutils.drawImage(db,2,1)
- paintutils.drawLine(1,19,51,19,colors.blue)
- paintutils.drawLine(1,1,1,18,colors.blue)
- paintutils.drawLine(51,1,51,18,colors.blue)
- else
- local db = paintutils.loadImage("/LUAOS/S/ddb.pic")
- paintutils.drawImage(db,2,1)
- paintutils.drawLine(1,19,51,19,colors.blue)
- paintutils.drawLine(1,1,1,18,colors.blue)
- paintutils.drawLine(51,1,51,18,colors.blue)
- end
- while true do
- if ma == "y" then
- paintutils.drawFilledBox(1,1,10,18,colors.lightBlue)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- print("LUAOS Menu")
- term.setBackgroundColor(colors.lightBlue)
- end
- local x1,y1 = 1,19 --menu
- local x2,y2 = 10,0
- local x3,y3 = 52,19
- local x4,y4 = 1,17 --reboot
- local x5,y5 = 1,18 --shutdown
- local x6,y6 = 1,2 --browse files
- local x7,y7 = 1,3 --accounts
- local x8,y8 = 1,4 --settings
- local x9,y9 = 1,5 --programs
- local x10,y10 = 1,6 --update
- local x11,y11 = 1,7 --Apps/Games
- local x12,y12 = 1,16 --sign out
- local choice1 = "Menu"
- local choice2 = "Reboot"
- local choice3 = "Shutdown"
- local choice4 = "Files"
- local choice5 = "Accounts"
- local choice6 = "Settings"
- local choice7 = "Programs"
- local choice8 = "Update"
- local choice9 = "Apps/Games"
- local choice10 = "Sign Out"
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(x1,y1)
- write(choice1)
- if ma == "y" then
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(x4,y4)
- write(choice2)
- term.setCursorPos(x5,y5)
- write(choice3)
- term.setCursorPos(x6,y6)
- write(choice4)
- term.setCursorPos(x7,y7)
- write(choice5)
- term.setCursorPos(x8,y8)
- write(choice6)
- term.setCursorPos(x9,y9)
- write(choice7)
- term.setCursorPos(x10,y10)
- write(choice8)
- term.setCursorPos(x11,y11)
- write(choice9)
- term.setCursorPos(x12,y12)
- write(choice10)
- end
- event, button, cx, cy = os.pullEvent()
- if event == "mouse_click" then
- if cx > x1 and cx < x1 + choice1:len() and cy == y1 and button == 1 and ma == "n" then
- ma = "y"
- end
- if cx > x2 and cx < x3 and cy > y2 and cy < y3 and button == 1 and ma == "y" then
- ma = "n"
- li(eid,t)
- end
- if cx > x4 and cx < x4 + choice2:len() and cy == y4 and button == 1 and ma == "y" then
- os.reboot()
- fs.delete("/LUAOS/S/Temp/eid")
- fs.delete("/LUAOS/S/Temp/t")
- break
- else if cx > x5 and cx < x5 + choice3:len() and cy == y5 and button == 1 and ma == "y" then
- os.shutdown()
- fs.delete("/LUAOS/S/Temp/eid")
- fs.delete("/LUAOS/S/Temp/t")
- break
- else if cx > x6 and cx < x6 + choice4:len() and cy == y6 and button == 1 and ma == "y" then
- term.clear()
- dir = "/LUAOS/C"
- term.setCursorPos(1,1)
- fb(dir,eid,t)
- break
- else if cx > x7 and cx < x7 + choice5:len() and cy == y7 and button == 1 and ma == "y" then
- ac(eid,t)
- break
- else if cx > x8 and cx < x8 + choice6:len() and cy == y8 and button == 1 and ma == "y" then
- --add settings
- else if cx > x9 and cx < x9 + choice7:len() and cy == y9 and button == 1 and ma == "y" then
- pl(eid,t)
- break
- else if cx > x10 and cx < x10 + choice8:len() and cy == y10 and button == 1 and ma == "y" then
- ud(eid,t)
- break
- else if cx > x11 and cx < x11 + choice9:len() and cy == y11 and button == 1 and ma == "y" then
- ag(eid,t)
- break
- else if cx > x12 and cx < x12 + choice10:len() and cy == y12 and button == 1 and ma == "y" then
- boot()
- break
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function uc1()
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.white)
- term.setCursorPos(3,3)
- print("welcome to the LUAOS first user setup")
- term.setCursorPos(3,4)
- print("your first user will be an administrator")
- term.setCursorPos(3,5)
- print("administrators can edit and add users")
- term.setCursorPos(3,6)
- print("while normal users cant, administrators")
- term.setCursorPos(3,7)
- print("can also install apps onto the PC but")
- term.setCursorPos(3,8)
- print("normal users also can if they have their")
- term.setCursorPos(3,9)
- print("administrators password.The ID of this")
- term.setCursorPos(3,10)
- print("account will be '1'")
- term.setCursorPos(3,11)
- print("press enter to create your account.")
- back = read()
- term.clear()
- term.setCursorPos(3,3)
- print("Now to make your administrator account")
- term.setCursorPos(3,5)
- print("Username:")
- term.setCursorPos(3,6)
- print("Password:")
- term.setCursorPos(12,5)
- nu = read()
- term.setCursorPos(12,6)
- np = read("*")
- nu = enc.encrypt(nu,"1user")
- np = enc.encrypt(np,"1pass")
- t = enc.encrypt(t,"1perm")
- fs.makeDir("/LUAOS/S/Users/1")
- f = fs.open("/LUAOS/S/Users/1/u", "w")
- f.write(nu)
- f.close()
- f = fs.open("/LUAOS/S/Users/1/p", "w")
- f.write(np)
- f.close()
- f = fs.open("/LUAOS/S/Users/1/t", "w")
- f.write(t)
- f.close()
- term.setCursorPos(3,8)
- print("Your new account has been made!")
- term.setCursorPos(3,9)
- print("Restarting now!")
- sleep(5)
- os.reboot()
- end
- function boot()
- term.clear()
- if not fs.exists("LUAOS/S/Users/1") then
- uc1()
- end
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Welcome to LUAOS login")
- term.setCursorPos(3,6)
- print("Enter your ID to contine")
- term.setCursorPos(3,9)
- eid = read()
- if not fs.exists("LUAOS/S/Users/"..eid) then
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Your ID is invalid, it may not exist")
- sleep(5)
- term.setCursorPos(3,5)
- print("Do you want to shutdown?, Y/N")
- local sEvent, param = os.pullEvent("key")
- if param == 21 then
- os.shutdown()
- else
- boot()
- end
- else if eid == "" then
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Your ID is invalid, it may not exist")
- sleep(5)
- term.setCursorPos(3,5)
- print("Do you want to shutdown?, Y/N")
- local sEvent, param = os.pullEvent("key")
- if param == 21 then
- os.shutdown()
- else
- boot()
- end
- end
- end
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(3,3)
- print("Now login to your account")
- term.setCursorPos(3,6)
- print("Username:")
- term.setCursorPos(3,8)
- print("Password:")
- term.setCursorPos(12,6)
- eu = read()
- term.setCursorPos(12,8)
- ep = read("*")
- dir1 = "/LUAOS/S/Users/"..eid.."/u"
- dir2 = "/LUAOS/S/Users/"..eid.."/p"
- dir3 = "/LUAOS/S/Users/"..eid.."/t"
- fu = fs.open(dir1,"r")
- ru = fu.readAll()
- fu.close()
- fp = fs.open(dir2,"r")
- rp = fp.readAll()
- fp.close()
- ft = fs.open(dir3,"r")
- t = ft.readAll()
- ft.close()
- eu1 = eid.."user"
- ep1 = eid.."pass"
- et1 = eid.."perm"
- ru = enc.decrypt(ru,eu1)
- rp = enc.decrypt(rp,ep1)
- t = enc.decrypt(t,et1)
- if eu == ru and ep == rp then
- term.setCursorPos(3,11)
- print("Welcome to LUAOS",ru)
- eid = enc.encrypt(eid,"teid")
- t = enc.encrypt(t,"tt")
- sleep(5)
- f1 = fs.open("/LUAOS/S/Temp/eid","w")
- f2 = fs.open("/LUAOS/S/Temp/t","w")
- f1.write(eid)
- f2.write(t)
- f1.close()
- f2.close()
- li()
- else
- term.setCursorPos(3,11)
- print("Incorrect username and/or password")
- print("Do you want to shutdown?, Y/N")
- local sEvent, param = os.pullEvent("key")
- if param == 21 then
- os.shutdown()
- else
- boot()
- end
- end
- end
- function recovery()
- term.clear()
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- term.setBackgroundColor(colors.lightBlue)
- print("something went wrong with booting your PC")
- print("recovery is going to try and fix this error now")
- print("if this does not work then recovery will")
- print("reinstall LUAOS for you, if this doesnt work")
- print("then report this to the owner of the OS")
- print("thank you for using LUAOS")
- sleep(20)
- fs.makeDir("/LUAOS")
- fs.makeDir("/LUAOS/C")
- fs.makeDir("/LUAOS/S")
- fs.makeDir("/LUAOS/S/Users")
- if not fs.exists("/LUAOS") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/LUAOS)")
- sleep(10)
- print("this computer will now shutdown")
- sleep(3)
- os.shutdown()
- end
- if not fs.exist("/LUAOS/C") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/LUAOS/C)")
- sleep(10)
- print("this computer will now shutdown")
- sleep(3)
- os.shutdown()
- end
- if not fs.exists("/LUAOS/S") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/LUAOS/S")
- sleep(10)
- print("this computer will now shutdown")
- sleep(3)
- os.shutdown()
- end
- if not fs.exists("/LUAOS/S/Users") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/LUAOS/S/Users)")
- sleep(10)
- print("this computer will now shutdown")
- sleep(3)
- os.shutdown()
- end
- if not fs.exists("/enc") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/enc)")
- sleep(10)
- print("this computer will now shutdown")
- sleep(3)
- os.shutdown()
- end
- print("LUAOS Recovery has fixed your computer, this computer will now restart")
- sleep(5)
- os.reboot()
- end
- function fc()
- if not fs.exists("/LUAOS") then
- print("/LUAOS does not exist, if you get this error please \n reinstall LUAOS or if that doesnt work \n then contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- if not fs.exists("/LUAOS/C") then
- print("/LUAOS/C does not exist, if you get this error please \n reinstall LUAOS or if that doesnt work \n then contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- if not fs.exists("/LUAOS/S") then
- print("/LUAOS/S does not exist, if you get this error please \n reinstall LUAOS or if that doesnt work \n then contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- if not fs.exists("/LUAOS/S/Users") then
- print("/LUAOS/S/Users does not exist, if you get this error please \n reinstall LUAOS or if that doesnt work \n then contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- if not fs.exists("/enc") then
- print("/LUAOS/S/Users does not exist, if you get this error please \n reinstall LUAOS or if that doesnt work \n then contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- print("all essential files succesfully found")
- sleep(5)
- boot()
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- build = "0.5 Indev"
- print("Welcome To LUAOS Version:",build)
- sleep(3)
- print("preparing to check files")
- textutils.slowPrint("|||||||||||||||||||||||||||||||||||||||||||||||||||")
- sleep(1)
- print("checking files now")
- if fs.exists("/LUAOSinstall") then
- fs.delete("/LUAOSinstall")
- end
- os.loadAPI("/enc")
- fc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement