xXm0dzXx

Untitled

Apr 25th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local direction = ">"
  2. mon = peripheral.wrap("top")
  3. term.redirect(mon)
  4. mon.setTextScale(0.5)
  5.  
  6.  
  7. function clear()
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. end
  11.  
  12. function change(param1)
  13. direction = param1
  14. end
  15.  
  16. function redraw()
  17. clear()
  18. write("\n+---+---+---+---+ +-Info-+\n")
  19. write("| | |Dir." ..direction.. " |\n")
  20. write("| | | |\n")
  21. write("| | +-Info-+\n")
  22. write("| |\n")
  23. write("+---+---+---+---+\n")
  24. write("| < | v | ^ | > |\n")
  25. write("+---+---+---+---+\n")
  26. if direction == ">" then
  27. term.setCursorPos(13, 7)
  28. elseif direction == "<" then
  29. term.setCursorPos(3, 7)
  30. elseif direction == "v" then
  31. term.setCursorPos(7, 7)
  32. elseif direction == "^" then
  33. term.setCursorPos(9, 7)
  34. end
  35.  
  36. write("^")
  37. end
  38.  
  39. while true do
  40. redraw()
  41. if rs.getInput("right") == true then
  42. clear()
  43. change(">")
  44. elseif rs.getInput("left") == true then
  45. clear()
  46. change("<")
  47. elseif rs.getInput("back") == true then
  48. clear()
  49. change("v")
  50. elseif rs.getInput("bottom") == true then
  51. clear()
  52. change("^")
  53. end
  54.  
  55. sleep(0)
  56. end
  57.  
  58. term.restore()
Advertisement
Add Comment
Please, Sign In to add comment