Advertisement
25hz

Turtle - Tree Farm Return

Oct 15th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. -- This little program sends the turtle
  2. -- back to the treefarm starting point
  3. -- and restarts the treefarm program
  4. -- if the tree farm program aborts
  5. -- while the turtle is at the dirt block.
  6. -- No variables needed.
  7.  
  8. function goForward(n)
  9.   for i=1,n do
  10.     turtle.forward()
  11.   end
  12. end
  13.  
  14. function Return()
  15.   turtle.turnLeft()
  16.   goForward(5)
  17.   turtle.turnRight()
  18.   goForward(5)
  19. end
  20.  
  21. turtle.down()
  22. turtle.dig()
  23.  
  24. for i=1,1 do
  25.   Return()
  26. end
  27.  
  28. turtle.turnLeft()
  29. turtle.turnLeft()
  30.  
  31. -- This section restarts the treefarm for you.
  32. shell.run("treefarm")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement