7thFullMoon

remote receiver

Jan 20th, 2013
81
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. end
  9. turtle.forward()
  10. elseif message == "TS Backward" then
  11. print("Backward")
  12. turtle.back()
  13. elseif message == "TS TurnLeft" then
  14. print("Turn Left")
  15. turtle.turnLeft()
  16. elseif message == "TS TurnRight" then
  17. print("Turn Right")
  18. turtle.turnRight()
  19. elseif message == "TS PlaceBlock" then
  20. if turtle.detect() == true then
  21. print("Block Present")
  22. else
  23. print("Place Block")
  24. turtle.place()
  25. end
  26. end
  27. end
  28. end
  29. rednet.open("right")
  30. textutils.slowPrint("TurtleReceive Initiated.")
  31. RCslave()
RAW Paste Data Copied