diff --git a/dominic/canemine.lua b/dominic/canemine.lua index 3b746fc..e1e4471 100644 --- a/dominic/canemine.lua +++ b/dominic/canemine.lua @@ -128,7 +128,7 @@ function digShaft() selectCobble() turtle.placeUp() turtle.down() - depth = digDeep(turtle.down, turtle.digDown, turtle.inspectDown, 1) + depth = digDeep(turtle.down, turtle.digDown, turtle.inspectDown, -1) turtle.turnLeft() digDeep(turtle.up, noop, noop, depth) turtle.turnLeft() @@ -234,15 +234,14 @@ function reportDuty(id, fuelconsumed) moveSafeForward() moveSafeForward() moveSafeForward() - print("Reporting Duty") rednet.open("bottom") - print("Proto: Sending completed Job id") + --print("Proto: Sending completed Job id") rednet.broadcast(tostring(id), "jobs") sleep(0.6) - print("Proto: Sending fuel status") + --print("Proto: Sending fuel status") rednet.broadcast(tostring(fuelconsumed), "fuel") while true do - print("Proto: Awaiting thanks") + --print("Proto: Awaiting thanks") sender, message, proto = rednet.receive("jobcomplete") if message == "thanks" then break @@ -250,7 +249,7 @@ function reportDuty(id, fuelconsumed) sleep(1) end end - print("Proto: Received thanks") + --print("Proto: Received thanks") end function enqueueTurtle() @@ -316,10 +315,14 @@ function waitForJob() end rednet.open("bottom") rednet.broadcast("gibjob", "jobs") - sender, message, proto = rednet.receive("newjob") - job = tonumber(message) - print("Received job "..tostring(job)) - return job + while true do + sender, message, proto = rednet.receive("newjob", 1) + if message then + job = tonumber(message) + print("Received job "..tostring(job)) + return job + end + end end function emptyToBarrel() @@ -345,7 +348,8 @@ while true do emptyToBarrel() leaveBarrel(path) fuelconsumed = fuel - turtle.getFuelLevel() - reportDuty(thejob, fuelconsumed) print("I consumed "..tostring(fuelconsumed).." fuel") + print("Reporting Duty") + reportDuty(thejob, fuelconsumed) enqueueTurtle() end diff --git a/dominic/server.lua b/dominic/server.lua index d2a06d5..76ed962 100644 --- a/dominic/server.lua +++ b/dominic/server.lua @@ -21,7 +21,7 @@ while true do if not message then sleep(0.6) else - print("> raw: "..message) + --print("> raw: "..message) if message == "gibjob" then if rs.getInput("right") then job = getNextJob()