Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Arg = {...}
- local function getBlockName()
- local isThere , blockInfo = turtle.inspect()
- if isThere then
- return blockInfo.name
- end
- return "air"
- end
- local function getBlockNameUp()
- local isThere , blockInfo = turtle.inspectUp()
- if isThere then
- return blockInfo.name
- end
- return "air"
- end
- local function checkIfMineble(blockname)
- print("im looking at ", blockname)
- if string.lower(blockname) == "minecraft:bedrock" then
- return false
- end
- return true
- end
- local function tryDigUntilClear()
- if checkIfMineble(getBlockName()) then
- while turtle.detect() do
- turtle.dig()
- end
- end
- end
- local function tryDigUpUntilClear()
- if checkIfMineble(getBlockNameUp()) then
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- end
- local tunnellenght = Arg[1]
- while tunnellenght ~= 0 do
- tryDigUntilClear()
- turtle.forward()
- turtle.turnRight()
- for i =1 , 2 ,1 do
- tryDigUntilClear()
- tryDigUpUntilClear()
- turtle.up()
- end
- tryDigUntilClear()
- turtle.turnLeft()
- turtle.turnLeft()
- for i =1 , 2 ,1 do
- tryDigUntilClear()
- turtle.down()
- end
- tryDigUntilClear()
- turtle.turnRight()
- tunnellenght = tunnellenght - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement