Advertisement
minif

startup1.1

Jan 25th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. --startup
  2. term.clear()
  3. term.setCursorPos(1,1)
  4.  
  5. --define functions
  6. osScreenSizeX, osScreenSizeY = term.getSize()
  7. function osFillBG(selColor)
  8. paintutils.drawFilledBox(1,1,osScreenSizeX,osScreenSizeY,selColor)
  9. term.setCursorPos(1,1)
  10. term.setBackgroundColor(selColor)
  11. if selColor == colors.white then
  12. term.setTextColor(colors.black)
  13. else
  14. term.setTextColor(colors.white)
  15. end
  16. end
  17.  
  18. function osBSOD(message, cause, tips)
  19. osFillBG(colors.blue)
  20. print("Critical System Error!")
  21. print(message)
  22. print(cause)
  23. print(tips)
  24. print("")
  25. print("Press any key to continue.")
  26. sleep(2)
  27. local blank1, blank2 = os.pullEvent()
  28. end
  29.  
  30. --check if on advanced
  31. if term.isColor() then else
  32. print("Incompatible Computer!")
  33. print("Continuing into CraftOS...")
  34. return
  35. end
  36.  
  37. --boot to craftos recovery
  38. osFillBG(colors.cyan)
  39. os.sleep(2)
  40.  
  41. if fs.exists("system/cores/mos") then else
  42. osBSOD("Critical core missing.","/system/cores/mos is missing, and is needed to run.","Please re-install this file")
  43. os.shutdown()
  44. end
  45.  
  46.  
  47.  
  48. --login script
  49. if fs.exists("system/login") then
  50. osFillBG(colors.black)
  51. shell.run("system/login")
  52. else
  53. if fs.exists("disk/system/login") then
  54. print("Found login file on disk.")
  55. print("Copying from disk...")
  56. fs.copy("disk/system/login","system/login")
  57. print("Copy complete! Shutting Down...")
  58. sleep(3)
  59. else
  60. osBSOD("Critical file missing.","/system/login is missing, and is needed to run.","Please re-install this file")
  61. end
  62. end
  63.  
  64. --os shutdown
  65. --os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement