add correction manuevuers for move

This commit is contained in:
Justus Wolff
2026-02-23 01:15:07 +01:00
parent 93d20c3e9e
commit 7886710d15

View File

@@ -306,6 +306,7 @@ local function move(direction, continousattempt)
turtle.turnRight() turtle.turnRight()
return return
end end
local correction = 0
while true do while true do
if turtle.getFuelLevel() == 0 then if turtle.getFuelLevel() == 0 then
reset() reset()
@@ -332,10 +333,15 @@ local function move(direction, continousattempt)
elseif not suc and continousattempt then elseif not suc and continousattempt then
reset() reset()
printError("Failure moving "..direction.." Continous attempt true.") printError("Failure moving "..direction.." Continous attempt true.")
move("forward", true)
correction = correction + 1
elseif suc then elseif suc then
break break
end end
end end
for _=1,correction,1 do
move("back", true)
end
end end
local function place(direction) local function place(direction)
local func = turtle.place local func = turtle.place