Advertisement
herobrinethree

control

Jul 29th, 2022 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. rednet.open("left")
  2. while true do
  3. local senderID, action, protocol = rednet.receive()
  4. print(action)
  5. if action == "forward" then
  6. turtle.forward()
  7. elseif action == "back" then
  8. turtle.back()
  9. elseif action == "right" then
  10. turtle.turnRight()
  11. elseif action == "left" then
  12. turtle.turnLeft()
  13. elseif action == "mine" then
  14. turtle.dig()
  15. elseif action == "up" then
  16. turtle.up()
  17. elseif action == "down" then
  18. turtle.down()
  19. elseif action == "keepForward" then
  20. repeat
  21. turtle.forward()
  22. until action ~= "keepForward"
  23. elseif action == "keepUp" then
  24. repeat
  25. turtle.up()
  26. until action ~= "keepUp"
  27. elseif action == "keepDown" then
  28. repeat
  29. turtle.down()
  30. until action ~= "keepDown"
  31. elseif action == "mineUp" then
  32. turtle.digUp()
  33. elseif action == "mineDown" then
  34. turtle.digDown()
  35. elseif action == "attack" then
  36. turtle.attack()
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement