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