add correction manuevuers for move
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user