diff --git a/libs/turtleutils.lua b/libs/turtleutils.lua index 13c7e70..5cba0b0 100644 --- a/libs/turtleutils.lua +++ b/libs/turtleutils.lua @@ -95,14 +95,17 @@ local function refuelIfNeeded() end while fuel < MIN_FUEL do - if statusCallback then statusCallback("out_of_fuel") end - + local x, y, z, gpsActive = M.getPosition() local posText = gpsActive and string.format("GPS (%d,%d,%d)", x, y, z) or string.format("Manual (%d,%d,%d)", x, y, z) - logger.log("No fuel. Waiting for fuel... Location: " .. posText) + if statusCallback then + statusCallback("out_of_fuel " .. posText) + end + + logger.log("No fuel. Waiting for fuel... Location: " .. posText) sleep(5) local added = refuelFromInventory(MIN_FUEL)