Advertisement
Guest User

pt

a guest
Oct 10th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local Var = 0
  2. local bRunning = true
  3.  
  4. function setC(x,y)
  5. term.setCursorPos(x,y)
  6. end
  7.  
  8. function clr()
  9. term.clear()
  10. setC(1,1)
  11. end
  12.  
  13. function checkKeys()
  14. event, key = os.pullEvent("key")
  15. if event == "key" then
  16. if key == keys.enter then
  17. clr()
  18. bRunning = false
  19. return
  20. elseif key == keys.up then
  21. clr()
  22. print(Var)
  23. Var = Var + 1
  24. elseif key == keys.down then
  25. clr()
  26. print(Var)
  27. Var = Var - 1
  28. end
  29.    end
  30.       end
  31.  
  32.  clr()
  33.  while bRunning do
  34.  sleep(0)
  35.  checkKeys()
  36.  if Var <= 6 then
  37.  term.setCursorPos(1,2)
  38.  print("GreaterThan")
  39.  elseif Var >= 5 then
  40.  term.setCursorPos(1,2)
  41.  print("LessThan   ")
  42.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement