From e985454913ab71c7fd1efec07520013ed1eabe99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Tue, 18 Aug 2020 18:33:26 +0200 Subject: [PATCH] Mine turtle: fix refuel --- turtles/mine.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/turtles/mine.lua b/turtles/mine.lua index 9c0ba0b..39c3ebf 100644 --- a/turtles/mine.lua +++ b/turtles/mine.lua @@ -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