Fix client

This commit is contained in:
Dominic Zimmer 2020-07-07 18:34:41 +02:00
parent 7f29b499ff
commit 286625904b

View File

@ -1,5 +1,6 @@
args = {...}
x, z, direction = 0, 0, 0
startfuel = nil
turtlestate = {
name = os.getComputerLabel(),
id = os.getComputerID(),
@ -644,7 +645,8 @@ function reportDuty2()
end
rednet.open("top")
id = turtlestate["job"]
fuelconsumed = turtlestate["fuel"]
fuelconsumed = turtle.getFuelLevel() - startfuel
turtlestate["fuel"] = fuelconsumed
rednet.broadcast(tostring(id), "jobs")
sleep(0.6)
--print("Proto: Sending fuel status")
@ -666,7 +668,9 @@ end
function turtleAI2()
while true do
local job = enqueueForJob2()
turtlestate["job"] = job
doRefuel2()
startfuel = turtle.getFuelLevel()
goToJob2(job)
digShaft()
goToUnloading()