Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Int--
- local w,h = term.getSize()
- local running = true
- local ms = 1
- local select = 1
- local os = {
- [1] = {"Epic win","Rainbow","Herp","Derp","Quit"}
- }
- --Functions--
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function center(str,ypos)
- term.setCursorPos(w/2-#str/2,ypos)
- write(str)
- end
- function draw()
- for i=1,#os[ms] do
- if i == select then
- center("[ "..os[ms][i].." ]",3*i)
- else
- center(os[ms][i],3*i)
- end
- end
- end
- --Main--
- draw()
- repeat
- local event , key = os.pullEvent(key)
- if key == 28 then
- running = false
- end
- sleep(0.1)
- until running == false
Advertisement
Add Comment
Please, Sign In to add comment