Advertisement
xKevinn

Untitled

Feb 12th, 2013
36
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. end
  42. end
  43. end
  44. rednet.open("right")
  45. textutils.slowPrint("TurtleReceive Initiated.")
  46. RCslave()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement