Advertisement
star_weaver

Untitled

Mar 2nd, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. local function RoxMaster()
  2. local run = 1
  3. while run == 1 do
  4. local sEvent, param = os.pullEvent("key")
  5. if sEvent == "key" then
  6. if param == 17 then
  7. rednet.broadcast("MoveForward")
  8. elseif param == 30 then
  9. rednet.broadcast("MoveLeft")
  10. elseif param == 31 then
  11. rednet.broadcast("MoveBack")
  12. elseif param == 32 then
  13. rednet.broadcast("MoveRight")
  14. elseif param == 18 then
  15. rednet.broadcast("MoveUp")
  16. elseif param == 16 then
  17. rednet.broadcast("MoveDown")
  18. elseif param == 33 then
  19. rednet.broadcast("DigForward")
  20. elseif param == 19 then
  21. rednet.broadcast("DigUp")
  22. elseif param == 46 then
  23. rednet.broadcast("DigDown")
  24. ------ Dav's additions for place, suck, and select -----
  25. elseif param == 13 then
  26. print("Which slot?")
  27. sleep(0.5)
  28. local selectslot = read()
  29. selectslot = tonumber(selectslot)
  30. if (selectslot~=nil) and (selectslot>0) and (selectslot<17) then
  31. rednet.broadcast("Select,"..selectslot)
  32. else
  33. print("Error: Must be number 1-16")
  34. sleep(2)
  35. end
  36. Menu()
  37. elseif param == 34 then
  38. rednet.broadcast("SuckForward")
  39. elseif param == 20 then
  40. rednet.broadcast("SuckUp")
  41. elseif param == 48 then
  42. rednet.broadcast("SuckDown")
  43. elseif param == 35 then
  44. rednet.broadcast("DropForward")
  45. elseif param == 21 then
  46. rednet.broadcast("DropUp")
  47. elseif param == 49 then
  48. rednet.broadcast("DropDown")
  49. elseif param == 36 then
  50. rednet.broadcast("PlaceForward")
  51. elseif param == 22 then
  52. rednet.broadcast("PlaceUp")
  53. elseif param == 50 then
  54. rednet.broadcast("PlaceDown")
  55. ------------------
  56. elseif param == 45 then
  57. rednet.broadcast("EndTurtle")
  58. textutils.slowPrint("Ended program on the")
  59. textutils.slowPrint("current Turtle and closed")
  60. textutils.slowPrint("it\'s Rednet connection.")
  61. print("--------------------------")
  62. elseif param == 44 then
  63. rednet.broadcast("EndBoth")
  64. run = 0
  65. rednet.close("back")
  66. textutils.slowPrint("Ended program on both")
  67. textutils.slowPrint("machines.")
  68. sleep(0.75)
  69. textutils.slowPrint("Closed rednet connection.")
  70. end
  71. end
  72. end
  73. end
  74. rednet.open("back")
  75. function Menu()
  76. term.clear()
  77. print("--------------------------")
  78. print("WASD to move.")
  79. print("E to rise.")
  80. print("Q to fall.")
  81. print("F to dig forward.")
  82. print("R to dig up.")
  83. print("C to dig down.")
  84. ----- Dav's Additions ---
  85. print("= to select slot.")
  86. print("G to suck forward.")
  87. print("T to suck up.")
  88. print("B to suck down.")
  89. print("H to drop forward.")
  90. print("Y to drop up.")
  91. print("N to drop down.")
  92. print("J to place forward.")
  93. print("U to place up.")
  94. print("M to place down.")
  95. ----------------
  96. print("X to stop current Turtle.")
  97. print("Z to exit.")
  98. end
  99. Menu()
  100. RoxMaster()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement