View difference between Paste ID: UjUSiHau and z5qswCDT
SHOW: | | - or go back to the newest paste.
1-
if turtle.getFuelLevel() == 0 then
1+
args = {...}
2
local depth = tonumber(args[1])
3-
  turtle.refuel(4)
3+
local width = tonumber(args[2])
4
local coals = math.floor(depth * width / 80)
5
6
if turtle.getFuelLevel() < (depth + width) * 2 then
7
  turtle.select(1)
8
  turtle.refuel(coals + 1)
9
end
10
local fuel = turtle.getFuelLevel()
11
print("fuel:"..tostring(fuel))
12
13
local function DigLine(n)
14
  for i=1, tonumber(n) do
15
    if turtle.detectDown() then
16
      print("dig")
17
      turtle.digDown()
18
    else
19
      print("skip")
20
    end
21-
DigLine(8)
21+
22
  end
23-
DigLine(8)
23+
24
25-
DigLine(8)
25+
26
DigLine(depth)
27-
DigLine(8)
27+
28
DigLine(width)
29-
turtle.back()
29+
30-
30+
DigLine(depth)
31
turtle.turnRight()
32
DigLine(width)
33
turtle.turnRight()
34
turtle.back()