Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ud(v)
- term.clear()
- term.setCursorPos(3,3)
- paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
- paintutils.drawBox(1,1,51,19,colors.blue)
- print("LUAOS version:", v)
- shell.run("pastebin get AC6USdEP version")
- f = fs.open("/version", "r")
- nv = f.readAll()
- f.close()
- print("the newest version of LUAOS is:", nv)
- if nv > v then
- u = y
- else
- u = n
- end
- if u == "y" then
- 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")
- sleep(5)
- os.reboot()
- end
- function li(eu)
- term.clear()
- term.setCursorPos(4,3)
- print("welcome to the LUAOS Indev 0.1 Menu")
- term.setCursorPos(4,6)
- print("1 : shutdown")
- term.setCursorPos(4,8)
- print("2 : restart")
- term.setCursorPos(4,10)
- print("3 : update")
- term.setCursorPos(4,12)
- print("4 : file browser")
- term.setCursorPos(4,16)
- s = read()
- if s == "1" then
- os.shutdown()
- else if s == "2" then
- os.reboot()
- else if s == "3" then
- v = 0.1
- ud(v)
- else if s == "4" then
- dofile("/LUAOS/C/filebrowser")
- else
- term.setCursorPos(4,17)
- print("selection not valid")
- sleep(3)
- li(eu)
- end
- end
- end
- end
- end
- function uc1()
- term.clear()
- 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.")
- 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("*")
- 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("a")
- 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()
- term.setTextColor(colors.white)
- if not fs.exists("/LUAOS/S/Users/1") then
- uc1()
- end
- term.setCursorPos(3,3)
- print("Welcome to LUAOS login")
- term.setCursorPos(3,5)
- print("Username:")
- term.setCursorPos(3,6)
- print("Password:")
- term.setCursorPos(12,5)
- eu = read()
- term.setCursorPos(12,6)
- ep = read("*")
- if fs.exists("/LUAOS/S/Users/1/u") and fs.exists("/LUAOS/S/Users/1/p") then
- f = fs.open("/LUAOS/S/Users/1/u", "r")
- ru = f.readLine(1)
- f.close()
- f = fs.open("/LUAOS/S/Users/1/p", "r")
- rp = f.readLine(1)
- f.close()
- if eu == ru and ep == rp then
- term.setCursorPos(3,8)
- print("welcome", eu)
- sleep(3)
- li(eu)
- else
- term.setCursorPos(3,8)
- print("your username and or password is incorrect")
- term.setCursorPos(3,9)
- print("would you like to shutdown your computer")
- term.setCursorPos(3,10)
- print("Y/N")
- local sEvent, param = os.pullEvent("key")
- if sEvent == "21" then
- os.shutdown()
- else
- os.reboot()
- end
- end
- else
- recovery()
- end
- end
- function recovery()
- term.clear()
- 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")
- shell.run("pastebin get 3TtKX5tR /LUAOS/C/filebrowser")
- 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("/LUAOS/C/filebrowser") then
- print("LUAOS Recovery has failed to fix your computer")
- print("please report this code to the owner")
- print("LUAOSRFSNE(/LUAOS/C/filebrowser)")
- 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("/LUAOS/C/filebrowsser") then
- print("/LUAOS/c/filebrowser does not exist, if you get this error please \n reinstall LUAOS of that doesnt work \n hen contact the owner, recovery will start now")
- sleep(10)
- recovery()
- end
- print("all essential drives files succesfully found")
- sleep(5)
- boot()
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- build = "0.1 Indev"
- print("Welcome To LUAOS Version:",build)
- sleep(3)
- print("preparing to check files")
- textutils.slowPrint("|||||||||||||||||||||||||||||||||||||||||||||||||||")
- sleep(1)
- print("checking files now")
- fc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement