Advertisement
RobotBubble

TurtleRemote

Oct 21st, 2017
150
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2. term.setCursorPos(1, 1)
  3. function RCslave()
  4. while true do
  5. local scrap, message = rednet.receive()
  6. if message == "TS Forward" then
  7. print("Forward + dig")
  8. turtle.dig()
  9. turtle.forward()
  10. elseif message == "TS ForwardN" then
  11. print("Forward - dig")
  12. turtle.forward()
  13. elseif message == "TS Backward" then
  14. print("Backward")
  15. turtle.back()
  16. elseif message == "TS Attack" then
  17. print("Attack")
  18. turtle.attack()
  19. elseif message == "TS TurnLeft" then
  20. print("Turn Left")
  21. turtle.turnLeft()
  22. elseif message == "TS TurnRight" then
  23. print("Turn Right")
  24. turtle.turnRight()
  25. elseif message == "TS PlaceBlock" then
  26. print("Block Present")
  27. turtle.place()
  28. elseif message == "TS Bridge" then
  29. print("Bridge")
  30. shell.run("TurtleBridge")
  31. elseif message == "TS ID" then
  32. shell.run("TurtleID")
  33. elseif message == "TS Cover" then
  34. print("Cover Protocol initiated...")
  35. shell.run("TurtleCover")
  36. elseif message == "TS PlaceUp" then
  37. print("Place block above")
  38. turtle.placeUp()
  39. elseif message == "TS PlaceDown" then
  40. print("Place block below")
  41. turtle.placeDown()
  42. elseif message == "TS UpN" then
  43. print("Up - dig")
  44. turtle.up()
  45. elseif message == "TS DownN" then
  46. print("Down - dig")
  47. turtle.down()
  48. elseif message == "TS Up" then
  49. print("Up + dig")
  50. turtle.digUp()
  51. turtle.up()
  52. elseif message == "TS Down" then
  53. print("Down + dig")
  54. turtle.digDown()
  55. turtle.down()
  56. elseif message == "TS VBridge" then
  57. shell.run("TurtleVBridge")
  58. shell.run("TurtleVBridge")
  59. shell.run("TurtleVBridge")
  60. elseif message == "TurtleName" then
  61. shell.run("TurtleName")
  62. elseif message == "TS Tunnel" then
  63. shell.run("TurtleTunnel")
  64. shell.run("TurtleTunnel")
  65. shell.run("TurtleTunnel")
  66. shell.run("TurtleTunnel")
  67. shell.run("TurtleTunnel")
  68. elseif message == "TurtleReboot" then
  69. os.reboot()
  70. elseif message == "TurtleShutdown" then
  71. os.shutdown()
  72. elseif message == "TS Stairs" then
  73. print("Stairs")
  74. shell.run("TurtleStairs")
  75. sleep(.5)
  76. shell.run("TurtleStairs")
  77. sleep(.5)
  78. shell.run("TurtleStairs")
  79. elseif message == "TS StairsD" then
  80. sleep(.1)
  81. shell.run("TurtleStairsD")
  82. sleep(.1)
  83. shell.run("TurtleStairsD")
  84. sleep(.1)
  85. shell.run("TurtleStairsD")
  86. elseif message == "TS StairsB" then
  87. shell.run("TurtleStairsB")
  88. elseif message == "TS Dig FWD" then
  89. print("Dig FWD")
  90. turtle.dig()
  91. elseif message == "TS Dig Up" then
  92. print("Dig Up")
  93. turtle.digUp()
  94. elseif message == "TS Dig Down" then
  95. print("Dig Down")
  96. turtle.digDown()
  97. elseif message == "TS Redstone FWD: On" then
  98. print("Redstone FWD: On")
  99. redstone.setOutput("front", true)
  100. elseif message == "TS Redstone FWD: Off" then
  101. print("Redstone FWD: Off")
  102. redstone.setOutput("front", false)
  103. elseif message == "1" then
  104. print("Select slot: 1")
  105. turtle.select(1)
  106. elseif message == "2" then
  107. print("Select slot: 2")
  108. turtle.select(2)
  109. elseif message == "3" then
  110. print("Select slot: 3")
  111. turtle.select(3)
  112. elseif message == "4" then
  113. print("Select slot: 4")
  114. turtle.select(4)
  115. elseif message == "5" then
  116. print("Select slot: 5")
  117. turtle.select(5)
  118. elseif message == "6" then
  119. print("Select slot: 6")
  120. turtle.select(6)
  121. elseif message == "7" then
  122. print("Select slot: 7")
  123. turtle.select(7)
  124. elseif message == "8" then
  125. print("Select slot: 8")
  126. turtle.select(8)
  127. elseif message == "9" then
  128. print("Select slot: 9")
  129. turtle.select(9)
  130. elseif message == "TS Menu" then
  131. print("Returning...")
  132. sleep(1)
  133. os.reboot()
  134. elseif message == "TS Refuel" then
  135. shell.run("refuel all")
  136. sleep(1)
  137. rednet.broadcast("Fuel: "..turtle.getFuelLevel() )
  138. elseif message == "TS Place" then
  139. print("Place block")
  140. turtle.place()
  141. end
  142. end
  143. end
  144. term.setCursorPos(9, 1)
  145. rednet.open("left")
  146. term.setTextColor(colors.green)
  147. term.clear()
  148. term.setCursorPos(12, 1)
  149. print("Bubble Bot Turtle")
  150. term.setCursorPos(10, 2)
  151. print("Hold CTRL + T to quit")
  152. term.setTextColor(colors.white)
  153. RCslave()
Advertisement
RAW Paste Data Copied
Advertisement