huggle

Untitled

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