Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isFiller(block)
- return block.name == "minecraft:diorite" or block.name == "minecraft:deepslate" or block.name == "minecraft:stone" or block.name == "minecraft:granite" or block.name == "minecraft:cob blestone" or block.name == "minecraft:cobbled_deepslate" or block.name == "minecraft:netherrack" or block.name == "minecraft:grass_block" or block.name == "minecraft:dirt" or block.name == "minecraft:water" or block.name == "minecraft:lava" or block.name == "minecraft:sand" or block.name == "minecraft:farmland" or block.name == "minecraft:chest" or block.name == "minecraft:shulker_box"
- 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
- turtle.dig()
- turtle.forward()
- 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