local function clear()
turtle.digUp()
turtle.digDown()
turtle.dig()
end
local function clearLine(n)
for _ = 1, n do
clear()
if not turtle.forward() then
return false
end
end
return true
end
local function clearArea(f, l)
if not clearLine(f - 1) then
return false
end
turtle.turnLeft()
if not clearLine(l - 1) then
return false
end
turtle.turnLeft()
if not clearLine(f - 1) then
return false
end
local repeats = math.floor(l / 2) - 1
for _ = 1, repeats do
turtle.turnLeft()
clear()
if not turtle.forward() then
return false
end
turtle.turnLeft()
if not clearLine(f - 2) then
return false
end
turtle.turnRight()
clear()
if not turtle.forward() then
return false
end
turtle.turnRight()
if not clearLine(f - 2) then
return false
end
end
end
local args = { ... }
local f = args[1] or 0
local l = args[2] or 0
local fl = turtle.getFuelLevel()
if fl >= f * l then
clearArea(f, l)
else
print 'not enougth of fueld'
end