Advertisement
Guest User

farm

a guest
Oct 5th, 2012
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. function cutTree()
  2. if turtle.detect() then
  3.  
  4. local h = 0
  5. turtle.digDown()
  6. turtle.down()
  7. while turtle.detect() do
  8. turtle.dig()
  9. turtle.digUp()
  10. turtle.up()
  11. h = h + 1
  12. end
  13. while h > 0 do
  14. turtle.digDown()
  15. turtle.down()
  16. h = h - 1
  17. end
  18. turtle.select(16)
  19. turtle.place()
  20. turtle.up()
  21.  
  22. else
  23.  
  24. turtle.digDown()
  25. turtle.down()
  26. if turtle.detect() then
  27. turtle.select(15)
  28. turtle.place()
  29. end
  30. turtle.digUp()
  31. turtle.up()
  32.  
  33. end
  34.  
  35. end
  36.  
  37. while true do
  38. for n = 1,3 do
  39. cutTree()
  40. turtle.turnRight()
  41. for n =1,4 do
  42. turtle.forward()
  43. end
  44. turtle.turnLeft()
  45. end
  46.  
  47. turtle.turnLeft()
  48. for n=1,12 do
  49. turtle.forward()
  50. end
  51. turtle.turnRight()
  52. sleep(60)
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement