R3C0NF16UR3D

yes no statement cc

Oct 11th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function yN()
  2. local n=1
  3. while true do
  4. local x, y=term.getCursorPos()
  5. term.clearLine()
  6. if n==1 then write(">YES< NO") else write (" YES >NO<") end
  7. term.setCursorPos(x, y)
  8. a, b=os.pullEvent()
  9. while a~="key" do a, b=os.pullEvent() end
  10. if b==203 and n==2 then n=1 end
  11. if b==205 and n==1 then n=2 end
  12. if b==28 then print("") break end
  13. end
  14. if n==1 then return true end
  15. if n==2 then return false end
  16. return false
  17. end
Add Comment
Please, Sign In to add comment