Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local numSapling = 0
- local saplingSlot = 15
- local fuelSlot = 16
- local success, tree = turtle.inspect()
- function checkFuel()
- if turtle.getFuelLevel() < 80 then
- turtle.select(fuelSlot)
- turtle.refuel(1)
- turtle.select(1)
- end
- end
- function plantSapling()
- turtle.select(saplingSlot)
- turtle.place()
- turtle.select(1)
- end
- function dance()
- turtle.turnLeft()
- turtle.turnRight()
- turtle.turnLeft()
- turtle.turnRight()
- turtle.turnLeft()
- turtle.turnRight()
- end
- function checkTree()
- while tree.name == "minecraft:birch_sapling" do
- turtle.turnLeft()
- success, tree = turtle.inspect()
- end
- cutTree()
- end
- function cutTree()
- turtle.dig()
- turtle.forward()
- while turtle.inspectUp() == true do
- turtle.digUp()
- turtle.up()
- end
- while turtle.inspectDown() == false do
- turtle.down()
- end
- turtle.back()
- plantSapling()
- success, tree = turtle.inspect()
- end
- function countSaplings()
- numSapling = turtle.getItemCount(saplingSlot)
- end
- function turtleStart()
- countSaplings()
- for i = 1, numSapling do
- checkFuel()
- checkTree()
- end
- end
- turtleStart()
Add Comment
Please, Sign In to add comment