Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --startup
- term.clear()
- term.setCursorPos(1,1)
- --define functions
- osScreenSizeX, osScreenSizeY = term.getSize()
- function osFillBG(selColor)
- paintutils.drawFilledBox(1,1,osScreenSizeX,osScreenSizeY,selColor)
- term.setCursorPos(1,1)
- term.setBackgroundColor(selColor)
- if selColor == colors.white then
- term.setTextColor(colors.black)
- else
- term.setTextColor(colors.white)
- end
- end
- function osBSOD(message, cause, tips)
- osFillBG(colors.blue)
- print("Critical System Error!")
- print(message)
- print(cause)
- print(tips)
- print("")
- print("Press any key to continue.")
- sleep(2)
- local blank1, blank2 = os.pullEvent()
- end
- --check if on advanced
- if term.isColor() then else
- print("Incompatible Computer!")
- print("Continuing into CraftOS...")
- return
- end
- --boot to craftos recovery
- osFillBG(colors.cyan)
- os.sleep(2)
- if fs.exists("system/cores/mos") then else
- osBSOD("Critical core missing.","/system/cores/mos is missing, and is needed to run.","Please re-install this file")
- os.shutdown()
- end
- --login script
- if fs.exists("system/login") then
- osFillBG(colors.black)
- shell.run("system/login")
- else
- if fs.exists("disk/system/login") then
- print("Found login file on disk.")
- print("Copying from disk...")
- fs.copy("disk/system/login","system/login")
- print("Copy complete! Shutting Down...")
- sleep(3)
- else
- osBSOD("Critical file missing.","/system/login is missing, and is needed to run.","Please re-install this file")
- end
- end
- --os shutdown
- --os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement