View difference between Paste ID: fSwraxy9 and 2U3dP0wF
SHOW: | | - or go back to the newest paste.
1-
local width = 61
1+
local width = 100
2
3
local torches = 2
4
5
local function refuel()
6
    if turtle.getFuelLevel() == 0 then
7
        local prev = turtle.getSelectedSlot()
8
        turtle.select(1)
9
        if not turtle.refuel(1) then
10
            print('Need more fuel')
11
            while not turtle.refuel(1) do
12
                sleep(1)
13
            end
14
        end
15
        turtle.select(prev)
16
    end
17
end
18
19
local function checkForTorch(x)
20-
	if (x+2) % 6 == 0 then
20+
	if (x+3) % 6 == 0 then
21
		turtle.digUp()
22
		turtle.placeUp()
23
	end
24
end
25
			
26
turtle.select(torches)
27
28
for i = 1, width do
29
    refuel()
30
	checkForTorch(i)
31
	turtle.forward()
32
end