Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get dNmedzr3 drill
- -- pastebin run dNmedzr3
- function dig()
- return turtle.dig()
- end
- local blacklist = {
- "minecraft:stone",
- "minecraft:cobblestone",
- "minecraft:dirt",
- "minecraft:grass",
- -- and so on
- }
- local _blist = {}
- local firsthit = false
- local fill = 0
- local drill = true
- local depth = 0
- -- Inverse blacklist for fast hashmap lookup
- for i = 1, #blacklist do
- _blist[blacklist[i]] = true
- end
- while drill do
- turtle.select(2)
- temp, data = turtle.inspectDown()
- if data.name == "minecraft:bedrock" then
- for i=0,depth-1 do
- turtle.up()
- if i >= (depth - (fill)) then
- turtle.select(2)
- turtle.placeDown()
- end
- end
- drill = false
- else
- if not turtle.detectDown() then
- if not firsthit then
- firsthit=true
- fill = depth + 1
- end
- end
- turtle.digDown()
- if turtle.down() then depth = depth + 1 end
- for j=1,4 do
- temp, block = turtle.inspect()
- if _blist[block["name"]] then
- --do nothing
- else
- dig()
- end
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement