Compare commits

..

1 commit

Author SHA1 Message Date
Théophile Bastian 3cb643761a Mine: keep next shaft position 2020-08-18 20:12:11 +02:00

View file

@ -185,39 +185,34 @@ function find_next_shaft()
go_to(next_shaft_height, 0, next_shaft_side)
while true do
for hei=1,MAX_HEIGHT-1 do
if side % 2 == 0 then
while hei < MAX_HEIGHT - 1 do
if is_shaft() then
return
end
if turtle.detectUp() then
turtle.digUp()
end
move_up()
end
if is_shaft() then
return
end
else
while height > 0 do
if is_shaft() then
return
end
if turtle.detectUp() then
turtle.digUp()
if turtle.detectDown() then
turtle.digDown()
end
move_down()
end
move_up()
end
if is_shaft() then
return
end
turn_abs(1)
if turtle.detect() then
turtle.dig()
end
move_forward()
turn_abs(0)
for hei=MAX_HEIGHT-1,1,-1 do
if is_shaft() then
return
end
if turtle.detectDown() then
turtle.digDown()
end
move_down()
end
if is_shaft() then
return
end
turn_abs(1)