Mine turtle: fix refuel

This commit is contained in:
Théophile Bastian 2020-08-18 18:33:26 +02:00
parent 503cf6c0e4
commit e985454913
1 changed files with 5 additions and 5 deletions

View File

@ -116,7 +116,7 @@ function refuel_turtle()
return false
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
local rc, desc = turtle.suckUp()
if not rc then
@ -193,11 +193,11 @@ end
-- Main function
function main()
if turtle.getFuelLevel() < FUEL_LOW then
refuel_turtle()
else
print("NO FUEL AT ALL.")
if turtle.getFuelLevel() < distance_to_refuel() then
print("Not enough fuel to begin with.")
return
elseif turtle.getFuelLevel() < FUEL_LOW then
refuel_turtle()
end
while true do