From 76f8ce50d4b34a903320c16ea3e07cced3641420 Mon Sep 17 00:00:00 2001 From: Olav Bakke Svendsen Date: Thu, 12 Oct 2023 00:57:40 +0200 Subject: [PATCH] Some nice stats to look at --- steam/temporary-coal-feeder.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/steam/temporary-coal-feeder.lua b/steam/temporary-coal-feeder.lua index a3a20cc..7984e73 100644 --- a/steam/temporary-coal-feeder.lua +++ b/steam/temporary-coal-feeder.lua @@ -1,21 +1,22 @@ -- very temporary coal feeder. --- local config = dofile=("temporary-coal-feeder.config") -local deployers = {} -local barrels = {} - local refill_when = function(amt) return amt < 2 end local refill_amt = 2 --- for peripherals, mactch deployers and barrels +local deployers = {} +local num_deployers = 0 +local barrels = {} +local num_barrels = 0 for _,p in pairs(peripheral.getNames()) do local deployer = string.match(p, "^create\:deployer_%d+$") local barrel = string.match(p, "^sophisticatedstorage\:limited_barrel_%d+$") if deployer then deployers[deployer] = peripheral.wrap(deployer) + num_deployers = num_deployers + 1 elseif barrel then barrels[barrel] = peripheral.wrap(barrel) + num_barrels = num_barrels + 1 end end @@ -58,9 +59,11 @@ while true do total_coal = total_coal + v str = str..tostring(v).." in "..string.match(k, "barrel_%d+$").."\n" end - print(tostring(total_coal).." coal available") - print(str) - + term.clear() + term.setCursorPos(1,1) + print(tostring(num_barrels).." barrels and "..tostring(num_deployers).." deployers connected\n") + print(num_deployers/2.." charcoal/minute needed") + print(tostring(total_coal).." available\n"..str.."\n") feed(stock) os.sleep(60) end -- 2.30.2