Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function move()
- turtle.dig()
- turtle.forward()
- end
- function turn()
- turtle.turnRight()
- move()
- end
- function chopUp()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- end
- function checkBelow()
- if turtle.detectDown() then
- success, data = turtle.inspectDown()
- if success then
- if data.name ~= "minecraft:log" or data.name ~= "minecraft:leaves" then
- return false
- else
- return true
- end
- end
- else
- return false
- end
- end
- function chopDown()
- repeat
- turtle.digDown()
- turtle.down()
- until not checkBelow()
- end
- function placeSapling()
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- end
- function reUp()
- if turtle.getItemCount(1) == 0 then
- turtle.select(1)
- turtle.suckDown()
- end
- end
- function treeGrew()
- local success, data = turtle.inspect()
- if success then
- if data.name == "minecraft:log" or data.name == "minecraft:log"then
- return true;
- else
- return false;
- end
- end
- end
- function growTree()
- repeat
- reUp()
- turtle.place()
- until treeGrew()
- end
- while true do
- growTree()
- move()
- chopUp()
- move()
- chopUp()
- chopDown()
- turn()
- chopUp()
- move()
- chopUp()
- chopDown()
- turn()
- placeSapling()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement