did stuff
This commit is contained in:
parent
08935bc26b
commit
2dad33cd6d
@ -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)
|
||||||
|
@ -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
|
||||||
@ -202,6 +204,14 @@ local function mineRow()
|
|||||||
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()
|
||||||
tutel.forward()
|
tutel.forward()
|
||||||
|
Loading…
Reference in New Issue
Block a user