Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Length = ...
- if Length ~= nil then
- Length = tonumber(Length)
- else
- print("enter Dig Length")
- Length = tonumber(io.read())
- end
- if Length == nil or Length < 0 then
- print("INVALID NUMBER")
- Length = false
- end
- local bannedBlocks = "yes"
- function findBlock()
- for i=1,16,1 do
- turtle.select(i)
- if turtle.getItemCount() > 0 and turtle.getItemDetail(i).name ~= "minecraft:gravel" then
- return i
- end
- end
- return false
- end
- if Length ~= false then
- while Length > 0 do
- if Length % 15 == 0 then
- print(Length," left to Bridge")
- end
- if turtle.detectDown() then
- if turtle.detectUp() then turtle.digUp() end
- if turtle.detect() then turtle.dig() end
- turtle.forward()
- Length = Length - 1
- else
- if turtle.getItemCount() > 0 then
- if not turtle.placeDown() then
- turtle.dropUp()
- end
- else
- local Slot = findBlock()
- if Slot ~= false then
- turtle.select(Slot)
- else
- break
- end
- end
- end
- end
- end
- if findBlock() then
- print("done")
- else
- print("out of blocks")
- end
- turtle.select(1)
Add Comment
Please, Sign In to add comment