Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Options(y,options)
- local n = 1
- term.setCursorPos(1,y)
- term.write("==options==")
- while true do
- for i = 1, #options do
- term.setCursorPos(1,i + y)
- if n == i then term.write(">> "..options[i]) else term.write("- "..options[i]) end
- end
- local a, b = os.pullEvent("key")
- if b == keys.w and n > 1 then n = n - 1 end
- if b == keys.s and n < #options then n = n + 1 end
- if b == keys.enter then break end
- end
- return n
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement