Advertisement
ScoutMaester

Wireless Turtle Reciever

Sep 8th, 2023 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. rednet.open("right", 50) -- Left is the side of the modem and 50 is the channel were using
  2. rednet.broadcast("Im connected")
  3. print("Now running rednet connection")
  4. while true do
  5. rednet.receive(msg)
  6. print(msg) -- This will print the message you have send from the pocket computer onto the turtle screen
  7. if msg == "tunnel" then
  8. local length = 0
  9. rednet.broadcast("How long?")
  10. rednet.receive(length)
  11. rednet.broadcast "Turtle will return when finished!"
  12. for length = length,2,-1 do
  13. turtle.digUp()
  14. turtle.dig()
  15. turtle.forward()
  16. end
  17. for length = length,2,-1 do
  18. turtle.turnRight()
  19. turtle.turnRight()
  20. turtle.forward()
  21. end
  22. turtle.turnRight()
  23. turtle.turnRight()
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement