From: Olav Bakke Svendsen Date: Wed, 11 Oct 2023 22:57:40 +0000 (+0200) Subject: Some nice stats to look at X-Git-Tag: stable-steam~31 X-Git-Url: http://git.olavbs.no/?a=commitdiff_plain;h=76f8ce50d4b34a903320c16ea3e07cced3641420;p=cc.git Some nice stats to look at --- 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