Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.gray)
- local function ERR(CODE,DESC)
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.red)
- term.clear()
- term.setTextColor(colors.white)
- print("AIOS BIOS OCCURED AN ERROR")
- print("--------------------------")
- print(DESC)
- print("--------------------------")
- print("The BIOS left the following error")
- print(CODE)
- print("COMMON CODE LETTERS")
- print("E > EXCPECTED")
- print("U > UNEXCPECTED")
- print("M >> MAIN")
- print("U >> UNKNOWN")
- print("--------------------------")
- print("AIOS BIOS WILL NOW ATTEMPT TO REBOOT")
- sleep(10)
- os.reboot()
- end
- local I = 0
- local J = 0
- local L = 1
- W,H = term.getSize()
- while true do
- I = I + 1
- J = J + 1
- if L == 40 then
- break
- end
- if I == 256 then
- I = 0
- else
- term.setCursorPos(L,J)
- print(string.char(I))
- if J == 10 then
- L = L + 1
- J = 0
- sleep(0)
- end
- end
- end
- sleep(0.5)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.lime)
- term.setCursorPos(1,1)
- term.clear()
- local function Centerd(s,oH)
- term.setCursorPos(((W/2)-(string.len(s)/2)),((H/2)-oH))
- end
- Centerd(" ",0)
- VER = "V3.00"
- print("AIOS "..VER)
- Centerd(" ",-5)
- print("strike space to enter bios!")
- Centerd(" ",-4)
- print("Strike any key or")
- E,KEY = os.pullEvent()
- if KEY == string.byte(" ") then
- term.clear()
- term.setCursorPos(1,1)
- print("LOADING AiOs BIOS "..VER.." MENU")
- local function GUI(Options,Text)
- term.setCursorPos(1,1)
- term.clear()
- for i = 1,#Options do
- term.setCursorPos(1,i*2)
- print(i..": "..Options[i])
- end
- for i = 1,#Text do
- term.setCursorPos(15,i*2)
- print(Text[i])
- end
- end
- --Op max len = 9
- Op = {"QUIT","SafeBoot","About"}
- Te = {"BOOT","security","Version | Creddits"}
- while true do
- sleep(0.25)
- GUI(Op,Te)
- sleep(0.5)
- term.setCursorPos(1,H-1)
- print("Option [#]? ")
- term.setCursorPos(13,H-1)
- local SEL = read()
- SEL = tonumber(SEL)
- if SEL == 1 then
- break
- elseif SEL == 2 then
- print("Not yet implemented")
- elseif SEL == 3 then
- term.clear()
- term.setCursorPos(1,1)
- print("AIOS BIOS "..VER.." on")
- print(os.version())
- print(os.date())
- sleep(2)
- else
- print("INVALID")
- sleep(0.5)
- end
- end
- else
- if fs.exists("os") then
- shell.run("os")
- elseif fs.exists(".os") then
- shell.run(".os")
- elseif fs.exists("init.lua") then
- shell.run("init.lua")
- elseif fs.exists("init") then
- shell.run("init")
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColour(colors.red)
- print("No OS found")
- while true do
- print("")
- print("SHELL: ")
- shell.run("fg "..read())
- sleep(1)
- multishell.setFocus(multishell.getCurrent())
- end
- end
- end
- sleep(5)
- shell.run(".BIOS")
- sleep(0.5)
- ERR("EM01","The BIOS reached the final line")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement