Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blockExists, blockLog = turtle.inspect()
- local step=0
- local function doStep()
- step = step + 1
- end
- while step <= 3 and not turtle.detect() do
- turtle.forward()
- doStep()
- if step == 3 then
- error('Could not find tree!')
- end
- end
- if blockExists and blockLog["name"] == "minecraft:log" then
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- turtle.back()
- textutils.slowPrint('Tree chopped')
Advertisement
Add Comment
Please, Sign In to add comment