Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. function clearTree()
  2. turtle.dig()
  3. turtle.forward()
  4. local cleared = false
  5. local tempHeight = 0
  6. repeat
  7. local tempBlock, n = turtle.inspectUp()
  8. if tempBlock then
  9. if n.name == "minecraft:log" then
  10. tempHeight = tempHeight + 1
  11. turtle.digUp()
  12. turtle.up()
  13. end
  14. else
  15. cleared = true
  16. end
  17. until(cleared == true)
  18. repeat
  19. turtle.down()
  20. tempHeight = tempHeight - 1
  21. until (tempHeight == 0)
  22. turtle.back()
  23. end
  24.  
  25. function nextTreeInRow()
  26. turtle.turnLeft()
  27. turtle.forward()
  28. turtle.forward()
  29. turtle.forward()
  30. turtle.forward()
  31. turtle.turnRight()
  32. end
  33.  
  34. function goToNextRow()
  35. turtle.turnRight()
  36. turtle.forward()
  37. turtle.turnLeft()
  38. turtle.forward()
  39. turtle.forward()
  40. turtle.forward()
  41. turtle.forward()
  42. turtle.turnLeft()
  43. turtle.forward()
  44. turtle.turnRight()
  45. end
  46.  
  47. function returnToStart()
  48. --16
  49. turtle.turnRight()
  50. turtle.forward()
  51. turtle.turnRight()
  52. for i = 0, 16, 1
  53. do
  54. turtle.forward()
  55. end
  56. turtle.turnRight()
  57. turtle.forward()
  58. turtle.turnRight()
  59. end
  60.  
  61. function startOfRow()
  62. turtle.turnRight()
  63. for i = 0, 12, 1
  64. do
  65. turtle.forward()
  66. end
  67. end
  68.  
  69. local length = 4
  70. local width = 5
  71.  
  72. for w = 1, width, 1
  73. do
  74. for l = 1, length, 1
  75. do
  76. clearTree()
  77. nextTreeInRow()
  78. end
  79. startOfRow()
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement