Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function HarvestTree()
- turtle.dig()
- turtle.forward()
- local treeHeight = 0
- repeat
- local success, data = turtle.inspectUp()
- --Dig up until there is nothing above the turtle
- if success then
- turtle.digUp()
- turtle.up()
- treeHeight = treeHeight + 1
- end
- until(turtle.inspectUp() == false)
- --Go back down to the stump
- for i = 0, treeHeight do
- turtle.digDown()
- turtle.down()
- end
- turtle.back()
- turtle.select(1)
- turtle.place()
- --Done harvesting
- print("Harvested Tree with height of", treeHeight)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement