kolyaventuri

fell

Jan 25th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. --[[ Simple lumberjack program for the wiki. Assumes the turtle is in the
  2. bottom left corner of a 10 ahead and 3 to the right area of clear dirt or
  3. grass. Also, only works for oak saplings, since they can grow next to each
  4. other. ]]--
  5. local saplings = 1 -- the slot where the saplings are
  6. turtle.select(saplings) -- select the saplings
  7. while turtle.getItemCount(saplings) > 0 do -- while more saplings in inventory
  8. for i = 1, 8 do -- plant 8 saplings in a row
  9. turtle.turnRight()
  10. if not turtle.compare() then -- if not a sapling, then a tree grew
  11. turtle.dig()
  12. turtle.forward()
  13. while turtle.detectUp() do -- dig tree out
  14. turtle.digUp()
  15. turtle.up()
  16. end
  17. while not turtle.detectDown() do -- back down to ground
  18. turtle.down()
  19. end
  20. turtle.back()
  21. turtle.place() -- put down new sapling
  22. end
  23. turtle.turnLeft()
  24. turtle.forward()
  25. end
  26. -- turn around and line up for next pass
  27. turtle.turnRight()
  28. turtle.forward()
  29. turtle.forward()
  30. turtle.turnRight()
  31. turtle.forward()
  32. os.sleep(30) -- sleep for 30 seconds to allow trees to grow
  33. end
Add Comment
Please, Sign In to add comment