diff --git a/src/main.lua b/src/main.lua index 3ddeb06..d598f3c 100644 --- a/src/main.lua +++ b/src/main.lua @@ -306,6 +306,7 @@ local function move(direction, continousattempt) turtle.turnRight() return end + local correction = 0 while true do if turtle.getFuelLevel() == 0 then reset() @@ -322,7 +323,7 @@ local function move(direction, continousattempt) turtle.select(current+1) end os.sleep(1) - end + end end local suc,reason = turtle[direction]() if not suc and not continousattempt then @@ -332,10 +333,15 @@ local function move(direction, continousattempt) elseif not suc and continousattempt then reset() printError("Failure moving "..direction.." Continous attempt true.") + move("forward", true) + correction = correction + 1 elseif suc then break end end + for _=1,correction,1 do + move("back", true) + end end local function place(direction) local func = turtle.place