-- 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
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