Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count=8
- chosen=1
- recordName={"back to menu","stop current","13","Cat","Far","Mall","Stal","Strad"}
- records={"","","13","cat","far","mall","stal","strad"}
- while true do
- term.clear()
- term.setCursorPos(2,1+chosen)
- term.write(">")
- for i=1,count,1 do
- term.setCursorPos(3,1+i)
- term.write(recordName[i])
- end
- event, arg = os.pullEvent()
- if event=="key" then
- if arg==keys.down then
- if chosen<count then
- chosen=chosen+1
- end
- elseif arg==keys.up then
- if chosen>1 then
- chosen=chosen-1
- end
- elseif arg==keys.enter then
- if chosen>0 then
- modem = peripheral.wrap("back")
- modem.transmit(50,65,records[chosen])
- end
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement