Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local _,target = turtle.inspect()
- function isFiller(block)
- return not (block.name == target.name);
- end
- function checkBlock(direction)
- if direction == 0 then
- local isBlock, block = turtle.inspectDown();
- if isBlock and not isFiller(block) then
- turtle.digDown()
- turtle.down()
- search()
- turtle.up()
- end
- elseif direction == 1 then
- local isBlock, block = turtle.inspect();
- if isBlock and not isFiller(block) then
- while not turtle.forward() do turtle.dig() end
- search()
- turtle.back()
- end
- elseif direction == 2 then
- local isBlock, block = turtle.inspectUp();
- if isBlock and not isFiller(block) then
- turtle.digUp()
- turtle.up()
- search()
- turtle.down()
- end
- end
- end
- function search()
- checkBlock(2)
- checkBlock(1)
- turtle.turnLeft()
- checkBlock(1)
- turtle.turnLeft()
- checkBlock(1)
- turtle.turnLeft()
- checkBlock(1)
- turtle.turnLeft()
- checkBlock(0)
- end
- search()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement