diff --git a/src/brulijam/lib/basic.lua b/src/brulijam/lib/basic.lua index 77fb8bd..2749a2a 100755 --- a/src/brulijam/lib/basic.lua +++ b/src/brulijam/lib/basic.lua @@ -50,7 +50,7 @@ local function getNtfyAddress() end function ntfy(msg) - http.post(getNtfyAddress(), msg) + http.post(getNtfyAddress(), "[" .. os.getComputerLabel() .. "] " .. msg) end function splitStringToArray(inputStr) diff --git a/src/brulijam/t-fiboMiner.lua b/src/brulijam/t-fiboMiner.lua index 00ce258..034b65e 100755 --- a/src/brulijam/t-fiboMiner.lua +++ b/src/brulijam/t-fiboMiner.lua @@ -81,7 +81,7 @@ local function savePos(prefix) local pos = tutel.getPos() basic.appendToFileNl("/brulijam/files/chests-turtle-miner-fibo.txt", prefix .. pos["x"] .. ", " .. pos["y"]+1 .. ", " .. pos["z"]) - basic.ntfy("[" .. os.getComputerLabel() .. "](Mining) " .. prefix .. pos["x"] .. ", " .. pos["y"]+1 .. ", " .. pos["z"]) + basic.ntfy("(Mining) " .. prefix .. pos["x"] .. ", " .. pos["y"]+1 .. ", " .. pos["z"]) end local function inventoryRework() @@ -144,7 +144,9 @@ local function inventoryRework() end if not spaceAvailable and not chestAvailable then - savePos("Turtle stopped") + --savePos("Turtle stopped") + local pos = tutel.getPos() + basic.ntfy("(Mining) " .. "Turtle stopped mining at " .. pos["x"] .. ", " .. pos["y"] .. ", " .. pos["z"]) shell.run("delete /brulijam/task.lua") shell.run("reboot") end @@ -201,6 +203,14 @@ local function mineRow() --mine a 3 Block high Tunnel for Blocks for i=state["dataCurrentPathProgress"], state["dataGoalPathProgress"]-2 do print("row: " .. state["dataCurrentRow"]+1 .. "/" .. state["dataGoalRows"] .. ", pathProgress: " .. state["dataCurrentPathProgress"]+1 .. "/" .. state["dataGoalPathProgress"]) + + -- check fuel level + if turtle.getFuelLevel() == 0 then + local pos = tutel.getPos() + basic.ntfy("(Mining) " .. "Turtle has no fuel at " .. pos["x"] .. ", " .. pos["y"] .. ", " .. pos["z"]) + shell.run("delete /brulijam/task.lua") + shell.run("reboot") + end tutel.secureDig() --turtle.forward()