Fix client
This commit is contained in:
parent
7f29b499ff
commit
286625904b
@ -1,5 +1,6 @@
|
|||||||
args = {...}
|
args = {...}
|
||||||
x, z, direction = 0, 0, 0
|
x, z, direction = 0, 0, 0
|
||||||
|
startfuel = nil
|
||||||
turtlestate = {
|
turtlestate = {
|
||||||
name = os.getComputerLabel(),
|
name = os.getComputerLabel(),
|
||||||
id = os.getComputerID(),
|
id = os.getComputerID(),
|
||||||
@ -644,7 +645,8 @@ function reportDuty2()
|
|||||||
end
|
end
|
||||||
rednet.open("top")
|
rednet.open("top")
|
||||||
id = turtlestate["job"]
|
id = turtlestate["job"]
|
||||||
fuelconsumed = turtlestate["fuel"]
|
fuelconsumed = turtle.getFuelLevel() - startfuel
|
||||||
|
turtlestate["fuel"] = fuelconsumed
|
||||||
rednet.broadcast(tostring(id), "jobs")
|
rednet.broadcast(tostring(id), "jobs")
|
||||||
sleep(0.6)
|
sleep(0.6)
|
||||||
--print("Proto: Sending fuel status")
|
--print("Proto: Sending fuel status")
|
||||||
@ -666,7 +668,9 @@ end
|
|||||||
function turtleAI2()
|
function turtleAI2()
|
||||||
while true do
|
while true do
|
||||||
local job = enqueueForJob2()
|
local job = enqueueForJob2()
|
||||||
|
turtlestate["job"] = job
|
||||||
doRefuel2()
|
doRefuel2()
|
||||||
|
startfuel = turtle.getFuelLevel()
|
||||||
goToJob2(job)
|
goToJob2(job)
|
||||||
digShaft()
|
digShaft()
|
||||||
goToUnloading()
|
goToUnloading()
|
||||||
|
Loading…
Reference in New Issue
Block a user