Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CUI(m)
- local n=1
- local l=#m
- while true do
- term.clear()
- term.setCursorPos(1,2)
- for i=1, l, 1 do
- if i==n then print(i, "["..m[i].."]") else print(i, m[i]) end
- end
- print("Select a number[arrow up/arrow down]")
- local a, b= os.pullEventRaw()
- if a == "key" then
- if b==200 and n>1 then n=n-1 end
- if b==208 and n<=l then n=n+1 end
- if b==28 then break end
- end
- end
- term.clear() term.setCursorPos(1,1)
- return n
- end
Add Comment
Please, Sign In to add comment