Compare commits

...

1 commit

Author SHA1 Message Date
Théophile Bastian e806819475 Mine turtle: fix refuel 2020-08-18 18:35:05 +02:00

View file

@ -116,7 +116,7 @@ function refuel_turtle()
return false return false
end end
go_to(DROP_POINT_H, DROP_POINT_D, DROP_POINT_S) go_to(FUEL_POINT_H, FUEL_POINT_D, FUEL_POINT_S)
while turtle.getFuelLevel() < FUEL_EXPECTATION do while turtle.getFuelLevel() < FUEL_EXPECTATION do
local rc, desc = turtle.suckUp() local rc, desc = turtle.suckUp()
if not rc then if not rc then
@ -195,8 +195,8 @@ end
function main() function main()
if turtle.getFuelLevel() < FUEL_LOW then if turtle.getFuelLevel() < FUEL_LOW then
refuel_turtle() refuel_turtle()
else elseif turtle.getFuelLevel() < distance_to_refuel() then
print("NO FUEL AT ALL.") print("Not enough fuel to begin with.")
return return
end end