did stuff

This commit is contained in:
Julian Brammer 2024-06-23 23:40:44 +02:00
parent 08935bc26b
commit 2dad33cd6d
2 changed files with 13 additions and 3 deletions

View File

@ -50,7 +50,7 @@ local function getNtfyAddress()
end end
function ntfy(msg) function ntfy(msg)
http.post(getNtfyAddress(), msg) http.post(getNtfyAddress(), "[" .. os.getComputerLabel() .. "] " .. msg)
end end
function splitStringToArray(inputStr) function splitStringToArray(inputStr)

View File

@ -81,7 +81,7 @@ local function savePos(prefix)
local pos = tutel.getPos() local pos = tutel.getPos()
basic.appendToFileNl("/brulijam/files/chests-turtle-miner-fibo.txt", prefix .. pos["x"] .. ", " .. pos["y"]+1 .. ", " .. pos["z"]) 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 end
local function inventoryRework() local function inventoryRework()
@ -144,7 +144,9 @@ local function inventoryRework()
end end
if not spaceAvailable and not chestAvailable then 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("delete /brulijam/task.lua")
shell.run("reboot") shell.run("reboot")
end end
@ -201,6 +203,14 @@ local function mineRow()
--mine a 3 Block high Tunnel for <distance> Blocks --mine a 3 Block high Tunnel for <distance> Blocks
for i=state["dataCurrentPathProgress"], state["dataGoalPathProgress"]-2 do for i=state["dataCurrentPathProgress"], state["dataGoalPathProgress"]-2 do
print("row: " .. state["dataCurrentRow"]+1 .. "/" .. state["dataGoalRows"] .. ", pathProgress: " .. state["dataCurrentPathProgress"]+1 .. "/" .. state["dataGoalPathProgress"]) 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() tutel.secureDig()
--turtle.forward() --turtle.forward()