fix(inferium-harvester): display of the harvest state

This commit is contained in:
Guillaume ARM 2024-05-22 00:17:49 +02:00
parent 0a9294310a
commit a29f8ac5cb

View File

@ -3,7 +3,7 @@ local utils = require('libs/utils')
local turtleUtils = require('libs/turtle-utils') local turtleUtils = require('libs/turtle-utils')
local config = require('config/harvesting') local config = require('config/harvesting')
local VERSION = "2.5.0" local VERSION = "2.5.1"
local INFERIUM_SERVER = 'inferium.com' local INFERIUM_SERVER = 'inferium.com'
local IDLE_TIME = 2 local IDLE_TIME = 2
local WAIT_ITEM_IDLE_TIME = 5 local WAIT_ITEM_IDLE_TIME = 5
@ -230,21 +230,21 @@ local function forward()
end end
local function harvestProcedure() local function harvestProcedure()
term.write('> harvest on ' .. tostring(config.length) .. ' blocks') term.write('> harvest on ' .. tostring(config.length) .. ' blocks ')
local nbHarvested = 0 local nbHarvested = 0
for i=1, config.length, 1 do for i=1, config.length, 1 do
if harvestDown(i) then if harvestDown(i) then
nbHarvested = nbHarvested + 1 nbHarvested = nbHarvested + 1
term.write(' .') term.write('.')
else else
term.write(' !') term.write('!')
end end
if i ~= config.length then if i ~= config.length then
forward() forward()
end end
end end
term.write('\n') print()
print('> ' .. tostring(nbHarvested) .. ' harvested crops') print('> ' .. tostring(nbHarvested) .. ' harvested crops')