Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function yN()
- local n=1
- while true do
- local x, y=term.getCursorPos()
- term.clearLine()
- if n==1 then
- term.clear()
- term.setCursorPos(1,1)
- print ("[ Start ]")
- print (" Stop ")
- else
- term.clear()
- term.setCursorPos(1,1)
- print (" Start ")
- print ("[ Stop ]")
- end
- term.setCursorPos(x, y)
- a, b=os.pullEvent()
- while a~="key" do a, b=os.pullEvent() end
- if b==200 and n==2 then
- n=1
- end
- if b==208 and n==1 then
- n=2
- end
- if b==28 then
- if n==1 then
- print("Start")
- else
- print("Stop")
- end
- break
- end
- end
- if n==1 then return true end
- if n==2 then return false end
- return false
- end
- yN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement