Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- local depth = tonumber(args[1])
- local width = tonumber(args[2])
- local coals = math.floor(depth * width / 80)
- if turtle.getFuelLevel() < (depth + width) * 2 then
- turtle.select(1)
- turtle.refuel(coals + 1)
- end
- local fuel = turtle.getFuelLevel()
- print("fuel:"..tostring(fuel))
- local function DigLine(n)
- for i=1, tonumber(n) do
- if turtle.detectDown() then
- print("dig")
- turtle.digDown()
- else
- print("skip")
- end
- turtle.forward()
- end
- end
- turtle.forward()
- DigLine(depth)
- turtle.turnRight()
- DigLine(width)
- turtle.turnRight()
- DigLine(depth)
- turtle.turnRight()
- DigLine(width)
- turtle.turnRight()
- turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment