Advertisement
xKevinn

Untitled

Feb 12th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function RCslave()
  2. while true do
  3. local scrap, message = rednet.receive()
  4. if message == "TS Forward" then
  5. print("Forward")
  6. if turtle.detect() == true then
  7. turtle.dig()
  8. else
  9. turtle.forward()
  10. end
  11. elseif message == "TS Backward" then
  12. print("Backward")
  13. turtle.back()
  14. elseif message == "TS TurnLeft" then
  15. print("Turn Left")
  16. turtle.turnLeft()
  17. elseif message == "TS TurnRight" then
  18. print("Turn Right")
  19. turtle.turnRight()
  20. elseif message == "TS MoveUp" then
  21. print("Move Up")
  22. if turtle.detectUp() == true then
  23. turtle.digUp()
  24. else
  25. turtle.up()
  26. end
  27. elseif message == "TS MoveDown" then
  28. print("Move Down")
  29. if turtle.detectDown() == true then
  30. turtle.digDown()
  31. else
  32. turtle.down()
  33. end
  34. elseif message == "TS PlaceBlock" then
  35. if turtle.detect() == true then
  36. print("Block Present")
  37. else
  38. print("Place Block")
  39. turtle.place()
  40. end
  41. elseif message == "TS Drop" then
  42. turtle.drop()
  43. elseif message == "TS PlaceDown" then
  44. if turtle.detectDown() == true then
  45. print("Block Present")
  46. else
  47. print("Place Block Below")
  48. turtle.placeDown()
  49. end
  50. elseif message == "TS Inv1" then
  51. turtle.select(1)
  52. elseif message == "TS Inv2" then
  53. turtle.select(2)
  54. elseif message == "TS Inv3" then
  55. turtle.select(3)
  56. elseif message == "TS Inv4" then
  57. turtle.select(4)
  58. elseif message == "TS Inv5" then
  59. turtle.select(5)
  60. elseif message == "TS Inv6" then
  61. turtle.select(6)
  62. elseif message == "TS Inv7" then
  63. turtle.select(7)
  64. elseif message == "TS Inv8" then
  65. turtle.select(8)
  66. elseif message == "TS Inv9" then
  67. turtle.select(9)
  68. end
  69. end
  70. end
  71. rednet.open("right")
  72. textutils.slowPrint("TurtleReceive Initiated.")
  73. RCslave()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement