diff --git a/mineleader.lua b/mineleader.lua index 38888f7..e4d80a4 100644 --- a/mineleader.lua +++ b/mineleader.lua @@ -396,12 +396,12 @@ local function moveTo(dest, relative) while not vectorEqual(dest, position) do local pos if relative then - pos = position - else pos = relativePos + else + pos = position end if oldPos ~= nil and vectorEqual(oldPos, pos) then - sendLog(FAILED, "Cannot proceed to due obstacle. XYZ being blocked: " .. tostring(xBlocked) .. "," .. tostring(yBlocked) .. "," .. tostring(zBlocked)) + sendLog(FAILED, "Cannot proceed due to obstacle. XYZ being blocked: " .. tostring(xBlocked) .. "," .. tostring(yBlocked) .. "," .. tostring(zBlocked)) break end oldPos = vector.new(pos.x, pos.y, pos.z); @@ -410,13 +410,13 @@ local function moveTo(dest, relative) sendLog(FAILED, "Unable to orient for X axis.") return end - xblocked = attemptMoveForward() + xblocked = not attemptMoveForward() end if position.y ~= dest.y then if dest.y - pos.y > 0 then - yBlocked = attemptMoveUp() + yBlocked = not attemptMoveUp() else - yBlocked = attemptMoveDown() + yBlocked = not attemptMoveDown() end end if pos.z ~= dest.z then @@ -424,7 +424,7 @@ local function moveTo(dest, relative) sendLog(FAILED, "Unable to orient for Z axis.") return end - zBlocked = attemptMoveForward() + zBlocked = not attemptMoveForward() end end end