Advertisement
Brodur

Untitled

Apr 9th, 2019
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. prompt = prompt or "Continue"
  2. lOpt = lOpt or "YES"
  3. rOpt = rOpt or "NO"
  4.  
  5. local n = 1
  6.  
  7. term.print(prompt)
  8.  
  9. while true do
  10. local x, y =term.getCursor()
  11. term.clearLine()
  12.  
  13. if n==1 then
  14. term.setCursor(x, y)
  15. term.clearLine()
  16. term.write ("["..lOpt.."] "..rOpt)
  17. else
  18. term.setCursor(x, y)
  19. term.clearLine()
  20. term.write(" "..lOpt.." ["..rOpt.."]")
  21. end
  22.  
  23. term.setCursor(x, y)
  24. local _,_,_,key = event.pull("key_down")
  25.  
  26. if key==203 then n=1 end
  27. if key==205 then n=2 end
  28. if key==28 then return n end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement