diff --git a/mine.lua b/mine.lua index e680822..5042cea 100644 --- a/mine.lua +++ b/mine.lua @@ -212,8 +212,6 @@ function dropOffItems (starting_point, go_back) print("Time to drop off what I got") -- Turn off mining mode.mine = { forward = true } - -- Note current position (assuming facing FORWARD) - local pos_state = getCurrentPos() -- Return to origin, facing BACK moveAbs(starting_point) moveAbs(V_ZERO) @@ -224,10 +222,9 @@ function dropOffItems (starting_point, go_back) turtle.drop() end turtle.select(1) - -- Return to current position, facing forward + -- Return to the mining zone, facing forward if go_back then moveAbs(starting_point) - moveAbs(pos_state) end end @@ -324,14 +321,13 @@ function split (block) end function process (stack, starting_point) - -- fuel and go to starting point refuelUntil(FUEL_RESERVE) mode.mine = { forward = true } if #stack == 0 then return nil end + checkAndDropOff(starting_point) local working = table.remove(stack):orient(getCurrentPos()) print("Working:", working:tostring()) if canMine(working) then - checkAndDropOff(starting_point) mine(working) else local new, remainder = split(working, mode.v) @@ -349,7 +345,7 @@ function run (v1, v2) process({ block }, starting_point) -- return to base - dropOffItems(starting_point) + dropOffItems(starting_point, false) turnToFace(FORWARD) end