Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function rujos()
- term.clear()
- term.setCursorPos(1,1)
- print 'Booting J:OS 1.7 Beta'
- sleep(1)
- end
- local function bootcraft()
- term.clear()
- term.setCursorPos(4,4)
- print 'booting CraftOS 1.7'
- sleep(1)
- end
- local function rejos()
- term.clear()
- term.setCursorPos(1,1)
- print 'Removing J:OS 1.7 Beta'
- sleep(1)
- end
- local w,h = term.getSize()
- local options = {
- {'Run-J:OS',4,4,rujos};
- {'Boot-CraftOS',4,5,bootcraft};
- {'Remove-J:OS',4,5,rejos};
- }
- local selection = 1
- while true do
- term.clear()
- for i, option in pairs(options) do
- if selection == i then
- term.setCursorPos(option[2] - 2, option[3])
- write '['
- term.setCursorPos(option[2] + #option[1] + 1, option[3])
- write ']'
- end
- term.setCursorPos(option[2], option[3])
- write(option[1])
- end
- local _, k = os.pullEvent('key')
- if k == keys.down then
- selection = (selection < #options)
- and selection + 1
- or 1
- elseif k == keys.up then
- selection = (selection > 1)
- and selection - 1
- or #options
- elseif k == keys.enter then
- local o = options[selection]
- local res = o[4] and o[4]() or true
- if res == false then
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement