Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function chopTree()
- turtle.dig()
- turtle.forward()
- local inspection = turtle.inspectUp()
- if inspection == false or inspection == nil then return end
- local counter = 0
- while inspection.name == "minecraft:log" do
- turtle.digUp()
- turtle.up()
- counter = counter + 1
- end
- for i=1,counter do
- turtle.down()
- end
- turtle.back()
- turtle.select(1)
- turtle.place()
- turtle.back()
- dropOff()
- end
- function dropOff()
- turtle.turnRight()
- turtle.turnRight()
- for i=3,16 do
- local detail = turtle.getItemDetail()
- if detail ~= nil and detail.name == "minecraft:sapling" then
- turtle.select(i)
- turtle.refuel(64)
- elseif detail ~= nil then
- turtle.select(i)
- turtle.drop()
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- function checkTree()
- turtle.forward()
- local inspection = turtle.inspectUp()
- if inspection == false or inspection == nil then
- turtle.back()
- return
- end
- if inspection.name == "minecraft:log" then
- chopTree()
- end
- turtle.back()
- end
- while true do
- checkTree()
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement