Advertisement
Guest User

boot

a guest
Apr 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. local w,h = term.getSize()
  2.  
  3. function printCentered(msg, height)
  4. term.setCursorPos(w/2 - #msg/2, height)
  5. term.write(msg)
  6. end
  7. function printWrappedRight(msg, height)
  8. term.setCursorPos(w - #msg, height)
  9. term.write(msg)
  10. end
  11.  
  12. if not fs.exists("m-os/desktop") then
  13. term.setBackgroundColor(colors.red)
  14. term.clear()
  15. term.setBackgroundColor(colors.gray)
  16. term.setCursorPos(1,1)
  17. term.clearLine()
  18. term.setTextColor(colors.white)
  19. print("Could not find file.")
  20. term.setBackgroundColor(colors.red)
  21. term.setCursorPos(1,2)
  22. print("M-OS could not find the file: m-os/desktop")
  23. print("If you would like to reinstall M-OS when you reboot, type Y. If not, type n.")
  24. sleep(1000000)
  25. end
  26.  
  27. if not fs.exists("m-os/images/bground") then
  28. term.setBackgroundColor(colors.red)
  29. term.clear()
  30. term.setBackgroundColor(colors.gray)
  31. term.setCursorPos(1,1)
  32. term.clearLine()
  33. term.setTextColor(colors.white)
  34. print("Could not find file.")
  35. term.setBackgroundColor(colors.red)
  36. term.setCursorPos(1,2)
  37. print("M-OS could not find the file: m-os/images/bground")
  38. print("If you would like to reinstall M-OS when you reboot, type Y. If not, type n.")
  39. sleep(1000000)
  40. end
  41.  
  42. if not fs.exists("m-os/settings") then
  43. term.setBackgroundColor(colors.red)
  44. term.clear()
  45. term.setBackgroundColor(colors.gray)
  46. term.setCursorPos(1,1)
  47. term.clearLine()
  48. term.setTextColor(colors.white)
  49. print("Could not find file.")
  50. term.setBackgroundColor(colors.red)
  51. term.setCursorPos(1,2)
  52. print("M-OS could not find the file: m-os/settings")
  53. print("If you would like to reinstall M-OS when you reboot, type Y. If not, type n.")
  54. sleep(1000000)
  55. end
  56.  
  57. if not fs.exists("m-os/programs/installed_programs") then
  58. term.setBackgroundColor(colors.red)
  59. term.clear()
  60. term.setBackgroundColor(colors.gray)
  61. term.setCursorPos(1,1)
  62. term.clearLine()
  63. term.setTextColor(colors.white)
  64. print("Could not find file.")
  65. term.setBackgroundColor(colors.red)
  66. term.setCursorPos(1,2)
  67. print("M-OS could not find the file: m-os/programs.installed_programs")
  68. print("If you would like to reinstall M-OS when you reboot, type Y. If not, type n.")
  69. sleep(1000000)
  70. end
  71.  
  72. term.setBackgroundColor(colors.lightGray)
  73. term.clear()
  74. local logo = paintutils.loadImage("m-os/images/logo")
  75. paintutils.drawImage(logo,w/2-6,h/2-4)
  76. term.setBackgroundColor(colors.lightGray)
  77. printCentered("Loading..",h/2+5)
  78. term.setBackgroundColor(colors.white)
  79. term.setCursorPos(w / 2 - 19 / 2,h/2+3)
  80. textutils.slowWrite(" ",25)
  81. term.clear()
  82. sleep(0.2)
  83. shell.run("m-os/logon")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement