Update client for lava/water
This commit is contained in:
parent
88a94caf74
commit
035ab99fcc
@ -106,6 +106,13 @@ function moveSafe(moveAction, inspectAction, digAction)
|
|||||||
if block["name"]:lower():find("turtle") then
|
if block["name"]:lower():find("turtle") then
|
||||||
-- turtle in front of me. lets wait for it to move
|
-- turtle in front of me. lets wait for it to move
|
||||||
sleep(0.6)
|
sleep(0.6)
|
||||||
|
elseif block["name"]:lower().find("water") or block["name"]:lower().find("lava") then
|
||||||
|
if moveAction() then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
digAction()
|
||||||
|
updateState({ state = "I am stuck trying to walk into a liquid." })
|
||||||
|
end
|
||||||
else
|
else
|
||||||
digAction()
|
digAction()
|
||||||
end
|
end
|
||||||
@ -414,13 +421,17 @@ function drawStatus()
|
|||||||
print()
|
print()
|
||||||
print(" \""..turtlestate["name"].."\"")
|
print(" \""..turtlestate["name"].."\"")
|
||||||
print()
|
print()
|
||||||
print()
|
|
||||||
if turtlestate["job"] then
|
if turtlestate["job"] then
|
||||||
print("Current job: "..tostring(turtlestate["job"]))
|
print("Current job: "..tostring(turtlestate["job"]))
|
||||||
else
|
else
|
||||||
print("Current job: ")
|
print("Current job: ")
|
||||||
end
|
end
|
||||||
print()
|
print()
|
||||||
|
if turtle["startfuel"] then
|
||||||
|
print("Starting Fuel: "..tostring(turtlestate["startfuel"]))
|
||||||
|
else
|
||||||
|
print("Starting Fuel: ")
|
||||||
|
end
|
||||||
if turtlestate["job"] then
|
if turtlestate["job"] then
|
||||||
print("Recent fuel usage: "..tostring(turtlestate["fuel"]))
|
print("Recent fuel usage: "..tostring(turtlestate["fuel"]))
|
||||||
else
|
else
|
||||||
@ -674,7 +685,7 @@ function turtleAI2()
|
|||||||
local job = enqueueForJob2()
|
local job = enqueueForJob2()
|
||||||
turtlestate["job"] = job
|
turtlestate["job"] = job
|
||||||
doRefuel2()
|
doRefuel2()
|
||||||
startfuel = turtle.getFuelLevel()
|
turtlestate["startfuel"] = turtle.getFuelLevel()
|
||||||
goToJob2(job)
|
goToJob2(job)
|
||||||
digShaft()
|
digShaft()
|
||||||
goToUnloading()
|
goToUnloading()
|
||||||
|
Loading…
Reference in New Issue
Block a user