RobotBubble

Remote

Oct 21st, 2017
192
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function RCmaster()
  2. while true do
  3. local sEvent, param = os.pullEvent("key")
  4. if(sEvent == "key" ) then
  5. if(param == 17) then
  6. rednet.broadcast("TS Forward")
  7. elseif (param == 31) then
  8. rednet.broadcast("TS Backward")
  9. elseif (param == 30) then
  10. rednet.broadcast("TS TurnLeft")
  11. elseif (param == 32) then
  12. rednet.broadcast("TS TurnRight")
  13. elseif (param == 18) then
  14. rednet.broadcast("TS PlaceBlock")
  15. elseif (param == 200) then
  16. rednet.broadcast("TS Up")
  17. elseif (param == 208) then
  18. rednet.broadcast("TS Down")
  19. elseif (param == 13) then
  20. rednet.broadcast("TS Redstone FWD: On")
  21. elseif (param == 12) then
  22. rednet.broadcast("TS Redstone FWD: Off")
  23. elseif (param == 11) then
  24. term.clear()
  25. term.setCursorPos(1, 1)
  26. rednet.broadcast("TS ID")
  27. local scrap, message = rednet.receive()
  28. print(message)
  29. sleep(1)
  30. elseif (param == 57) then
  31. shell.run("remote2")
  32. elseif (param == 35) then
  33. term.clear()
  34. term.setCursorPos(1, 1)
  35. term.setTextColor(colors.white)
  36. print("Dig:")
  37. term.setCursorPos(5, 1)
  38. term.setTextColor(colors.green)
  39. print("on")
  40. term.setCursorPos(1, 2)
  41. term.setTextColor(colors.white)
  42. print("TAB to exit")
  43. print("G for Controls2")
  44. print("WASD to move")
  45. print("Arrow keys up/down")
  46. print("E to place")
  47. print("V to place down")
  48. print("B to place up")
  49. print("+ to + Redstone FWD")
  50. print("- to - Redstone FWD")
  51. print("F to fuel")
  52. print("Q to dig forward")
  53. print("Y to dig up")
  54. print("U to dig down")
  55. print("X to attack")
  56. print("1-9 to select slot")
  57. print("M to return to menu")
  58. print("SPACE to turn dig on/off")
  59. term.setCursorPos(17, 1)
  60. print("Slot:")
  61. term.setCursorPos(23, 1)
  62. term.setTextColor(colors.yellow)
  63. print("?")
  64. term.setTextColor(colors.white)
  65. elseif (param == 34) then
  66. term.clear()
  67. term.setCursorPos(1, 1)
  68. term.setTextColor(colors.lightGray)
  69. print("Dig:")
  70. term.setTextColor(colors.green)
  71. term.setCursorPos(5, 1)
  72. print("on")
  73. term.setTextColor(colors.lightGray)
  74. print("TAB to exit")
  75. print("H for Controls1")
  76. print("0 for ID program")
  77. print("J for dstairsUp program")
  78. print("K for dstairsDown program")
  79. print("L for bstairsUp program")
  80. print("N for bridge program")
  81. print("Z for vbridge program")
  82. print("P for tunnel program")
  83. print("C for cover program")
  84. print("M to return to menu")
  85. term.setCursorPos(17, 1)
  86. print("Slot:")
  87. term.setCursorPos(23, 1)
  88. term.setTextColor(colors.yellow)
  89. print("?")
  90. term.setTextColor(colors.white)
  91. elseif (param == 44) then
  92. rednet.broadcast("TS VBridge")
  93. elseif (param == 47) then
  94. rednet.broadcast("TS PlaceDown")
  95. elseif (param == 48) then
  96. rednet.broadcast("TS PlaceUp")
  97. elseif (param == 45) then
  98. rednet.broadcast("TS Attack")
  99. elseif (param == 25) then
  100. rednet.broadcast("TS Tunnel")
  101. elseif (param == 2) then
  102. term.setCursorPos(17, 1)
  103. print("Slot:")
  104. term.setCursorPos(23, 1)
  105. term.setTextColor(colors.blue)
  106. print("1")
  107. term.setTextColor(colors.white)
  108. rednet.broadcast("1")
  109. elseif (param == 3) then
  110. term.setCursorPos(17, 1)
  111. print("Slot:")
  112. term.setCursorPos(23, 1)
  113. term.setTextColor(colors.blue)
  114. print("2")
  115. term.setTextColor(colors.white)
  116. rednet.broadcast("2")
  117. elseif (param == 4) then
  118. term.setCursorPos(17, 1)
  119. print("Slot:")
  120. term.setCursorPos(23, 1)
  121. term.setTextColor(colors.blue)
  122. print("3")
  123. term.setTextColor(colors.white)
  124. rednet.broadcast("3")
  125. elseif (param == 5) then
  126. term.setCursorPos(17, 1)
  127. print("Slot:")
  128. term.setCursorPos(23, 1)
  129. term.setTextColor(colors.blue)
  130. print("4")
  131. term.setTextColor(colors.white)
  132. rednet.broadcast("4")
  133. elseif (param == 6) then
  134. term.setCursorPos(17, 1)
  135. print("Slot:")
  136. term.setCursorPos(23, 1)
  137. term.setTextColor(colors.blue)
  138. print("5")
  139. term.setTextColor(colors.white)
  140. rednet.broadcast("5")
  141. elseif (param == 7) then
  142. term.setCursorPos(17, 1)
  143. print("Slot:")
  144. term.setCursorPos(23, 1)
  145. term.setTextColor(colors.blue)
  146. print("6")
  147. term.setTextColor(colors.white)
  148. rednet.broadcast("6")
  149. elseif (param == 8) then
  150. term.setCursorPos(17, 1)
  151. print("Slot:")
  152. term.setCursorPos(23, 1)
  153. term.setTextColor(colors.blue)
  154. print("7")
  155. term.setTextColor(colors.white)
  156. rednet.broadcast("7")
  157. elseif (param == 9) then
  158. term.setCursorPos(17, 1)
  159. print("Slot:")
  160. term.setCursorPos(23, 1)
  161. term.setTextColor(colors.blue)
  162. print("8")
  163. term.setTextColor(colors.white)
  164. rednet.broadcast("8")
  165. elseif (param == 10) then
  166. term.setCursorPos(17, 1)
  167. print("Slot:")
  168. term.setCursorPos(23, 1)
  169. term.setTextColor(colors.blue)
  170. print("9")
  171. term.setTextColor(colors.white)
  172. rednet.broadcast("9")
  173. elseif (param == 36) then
  174. rednet.broadcast("TS Stairs")
  175. elseif (param == 37) then
  176. rednet.broadcast("TS StairsD")
  177. elseif (param == 38) then
  178. rednet.broadcast("TS StairsB")
  179. elseif (param == 15) then
  180. rednet.broadcast("TS Leave")
  181. os.reboot()
  182. elseif (param == 49) then
  183. rednet.broadcast("TS Bridge")
  184. elseif (param == 50) then
  185. term.clear()
  186. term.setCursorPos(1, 1)
  187. term.setTextColor(colors.white)
  188. shell.run("menu")
  189. elseif (param == 16) then
  190. rednet.broadcast("TS Dig FWD")
  191. elseif (param == 21) then
  192. rednet.broadcast("TS Dig Up")
  193. elseif (param == 22) then
  194. rednet.broadcast("TS Dig Down")
  195. elseif (param == 46) then
  196. rednet.broadcast("TS Cover")
  197. elseif (param == 33) then
  198. rednet.broadcast("TS Refuel")
  199. local scrap, message = rednet.receive()
  200. term.setCursorPos(1, 19)
  201. term.setTextColor(colors.white)
  202. textutils.slowPrint(message)
  203. term.setTextColor(colors.white)
  204. end
  205. end
  206. end
  207. end
  208. rednet.open("back")
  209. term.clear()
  210. term.setCursorPos(1, 1)
  211. rednet.broadcast("1")
  212. term.setTextColor(colors.white)
  213. print("Dig:")
  214. term.setCursorPos(5, 1)
  215. term.setTextColor(colors.green)
  216. print("on")
  217. term.setCursorPos(1, 2)
  218. term.setTextColor(colors.white)
  219. print("TAB to exit")
  220. print("G for Controls2")
  221. print("WASD to move")
  222. print("Arrow keys up/down")
  223. print("E to place")
  224. print("V to place down")
  225. print("B to place up")
  226. print("+ to + Redstone FWD")
  227. print("- to - Redstone FWD")
  228. print("F to fuel")
  229. print("Q to dig forward")
  230. print("Y to dig up")
  231. print("U to dig down")
  232. print("X to attack")
  233. print("1-9 to select slot")
  234. print("M to return to menu")
  235. print("SPACE to turn dig on/off")
  236. term.setCursorPos(17, 1)
  237. print("Slot:")
  238. term.setTextColor(colors.blue)
  239. term.setCursorPos(23, 1)
  240. print("1")
  241. term.setTextColor(colors.white)
  242. RCmaster()
RAW Paste Data