Advertisement
LazerAio

.BIOS

Mar 10th, 2022
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. term.setBackgroundColor(colors.gray)
  2. local function ERR(CODE,DESC)
  3. term.setCursorPos(1,1)
  4. term.setBackgroundColor(colors.red)
  5. term.clear()
  6. term.setTextColor(colors.white)
  7. print("AIOS BIOS OCCURED AN ERROR")
  8. print("--------------------------")
  9. print(DESC)
  10. print("--------------------------")
  11. print("The BIOS left the following error")
  12. print(CODE)
  13. print("COMMON CODE LETTERS")
  14. print("E > EXCPECTED")
  15. print("U > UNEXCPECTED")
  16. print("M >> MAIN")
  17. print("U >> UNKNOWN")
  18. print("--------------------------")
  19. print("AIOS BIOS WILL NOW ATTEMPT TO REBOOT")
  20. sleep(10)
  21. os.reboot()
  22. end
  23. local I = 0
  24. local J = 0
  25. local L = 1
  26. W,H = term.getSize()
  27. while true do
  28. I = I + 1
  29. J = J + 1
  30. if L == 40 then
  31. break
  32. end
  33. if I == 256 then
  34. I = 0
  35. else
  36. term.setCursorPos(L,J)
  37. print(string.char(I))
  38. if J == 10 then
  39. L = L + 1
  40. J = 0
  41. sleep(0)
  42. end
  43. end
  44. end
  45. sleep(0.5)
  46. term.setBackgroundColor(colors.black)
  47. term.setTextColor(colors.lime)
  48. term.setCursorPos(1,1)
  49. term.clear()
  50. local function Centerd(s,oH)
  51. term.setCursorPos(((W/2)-(string.len(s)/2)),((H/2)-oH))
  52. end
  53. Centerd(" ",0)
  54. VER = "V3.00"
  55. print("AIOS "..VER)
  56. Centerd(" ",-5)
  57. print("strike space to enter bios!")
  58. Centerd(" ",-4)
  59. print("Strike any key or")
  60. E,KEY = os.pullEvent()
  61. if KEY == string.byte(" ") then
  62. term.clear()
  63. term.setCursorPos(1,1)
  64. print("LOADING AiOs BIOS "..VER.." MENU")
  65. local function GUI(Options,Text)
  66. term.setCursorPos(1,1)
  67. term.clear()
  68. for i = 1,#Options do
  69. term.setCursorPos(1,i*2)
  70. print(i..": "..Options[i])
  71. end
  72. for i = 1,#Text do
  73. term.setCursorPos(15,i*2)
  74. print(Text[i])
  75. end
  76. end
  77. --Op max len = 9
  78. Op = {"QUIT","SafeBoot","About"}
  79. Te = {"BOOT","security","Version | Creddits"}
  80. while true do
  81. sleep(0.25)
  82. GUI(Op,Te)
  83. sleep(0.5)
  84. term.setCursorPos(1,H-1)
  85. print("Option [#]? ")
  86. term.setCursorPos(13,H-1)
  87. local SEL = read()
  88. SEL = tonumber(SEL)
  89. if SEL == 1 then
  90. break
  91. elseif SEL == 2 then
  92. print("Not yet implemented")
  93. elseif SEL == 3 then
  94. term.clear()
  95. term.setCursorPos(1,1)
  96. print("AIOS BIOS "..VER.." on")
  97. print(os.version())
  98. print(os.date())
  99. sleep(2)
  100. else
  101. print("INVALID")
  102. sleep(0.5)
  103. end
  104. end
  105. else
  106. if fs.exists("os") then
  107. shell.run("os")
  108. elseif fs.exists(".os") then
  109. shell.run(".os")
  110. elseif fs.exists("init.lua") then
  111. shell.run("init.lua")
  112. elseif fs.exists("init") then
  113. shell.run("init")
  114. else
  115. term.clear()
  116. term.setCursorPos(1,1)
  117. term.setTextColour(colors.red)
  118. print("No OS found")
  119. while true do
  120. print("")
  121. print("SHELL: ")
  122. shell.run("fg "..read())
  123. sleep(1)
  124. multishell.setFocus(multishell.getCurrent())
  125.  
  126. end
  127. end
  128. end
  129. sleep(5)
  130. shell.run(".BIOS")
  131. sleep(0.5)
  132. ERR("EM01","The BIOS reached the final line")
  133.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement