Guest User

Untitled

a guest
Apr 25th, 2019
80
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 Bomb" then
  20. print("Turn Left")
  21. turtle.PlaceDown()
  22. redstone.setOutput("bottom", true)
  23. sleep(0.5)
  24. redstone.setOutput("bottom", false)
  25. elseif message == "TS PlaceBlock" then
  26. if turtle.detect() == true then
  27. print("Block Present")
  28. else
  29. print("Place Block")
  30. turtle.place()
  31. end
  32. elseif message == "TS Up" then
  33. print("Up")
  34. elseif turtle.detectUp == true then
  35. turtle.digUp()
  36. end
  37. turtle.up()
  38. elseif message == "TS Down" then
  39. print("Down")
  40. if turtle.detectDown() == true then
  41. turtle.digDown()
  42. end
  43. turtle.down()
  44. end
  45. end
  46. end
  47. rednet.open("right")
  48. textutils.slowPrint("TurtleReceive Initiated.")
  49. RCslave()
RAW Paste Data