feat(inferium-harvester): better refuel procedure using buffer chest

This commit is contained in:
Guillaume ARM 2024-05-19 23:53:50 +02:00
parent ea4f132f2e
commit 5216041e76

View File

@ -1,7 +1,7 @@
local turtleUtils = require('libs/turtle-utils')
local config = require('config/harvesting')
local VERSION = "0.3.1"
local VERSION = "0.4.0"
local IDLE_TIME = 2
local MIN_FUEL_NEEDED = (10 + config.firstCropZ + config.length) * 2
local MIN_FREE_SLOTS_BEFORE_COMPACT = 4
@ -90,9 +90,8 @@ end
local function refuelProcedure()
turtle.turnLeft()
turtleUtils.waitForInventory('front', IDLE_TIME)
local refuelOk, refuelErr = turtleUtils.refuel(MIN_FUEL_NEEDED, turtle.suck, IDLE_TIME)
local refuelOk, refuelErr = turtleUtils.refuelWithBuffer('top', 'front', MIN_FUEL_NEEDED, IDLE_TIME)
if not refuelOk then
error('Cannot refuel the turtle: "' .. refuelErr .. '"')