Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local list1 = "CraftOS"
- local list1selected = true
- local list2 = "Reboot"
- local list2selected = false
- local list3 = "Shutdown"
- local list3selected = false
- function redraw()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- print("ComputerCraft Universal Bootloader")
- term.setCursorPos(1,3)
- end
- function countdown(startval)
- for i = 1, startval, -1 do
- term.clear()
- redraw()
- print("Computer is automatically starting in "..i)
- end
- end
- function rawread()
- while true do
- local sEvent, param = os.pullEvent("key")
- if sEvent == "key" then
- if param == 208 then
- if list1selected == true then
- term.clear()
- redraw()
- list2selected = true
- list1selected = false
- elseif list2selected == true then
- term.clear()
- redraw()
- list1selected = true
- list2selected = false
- end
- elseif param == 200 then
- if list2selected == true then
- term.clear()
- redraw()
- list2selected = false
- list1selected = true
- elseif list3selected == true then
- term.clear()
- redraw()
- list3selected = false
- list2selected = true
- elseif param == 28 then
- if list1selected == true then
- term.clear()
- shell.run("shell")
- elseif list2selected == true then
- os.reboot()
- elseif list3selected == true then
- os.shutdown()
- end
- end
- end
- end
- if list1selected == true then
- term.clear()
- redraw()
- term.setBackgroundColor(128)
- print(list1)
- term.setBackgroundColor(256)
- print(list2)
- print(list3)
- elseif list2selected == true then
- term.clear()
- redraw()
- term.setBackgroundColor(256)
- print(list1)
- term.setBackgroundColor(128)
- print(list2)
- term.setBackgroundColor(256)
- print(list3)
- elseif list3selected == true then
- term.clear()
- redraw()
- term.setBackgroundColor(256)
- print(list1)
- print(list2)
- term.setBackgroundColor(128)
- print(list3)
- end
- end
- end
- rawread()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement