Im looking to create a simple combinator mod that filters circuit signals by types (item,fluid,virtual)
i have a rough outline of code that works on a LUA combinator 3 based on https://lua-api.factorio.com/latest/Lua ... rk.signals
Code: Select all
on_tick = function(event)
output= {}
local red = combinator.get_control_behavior().get_circuit_network(defines.wire_type.red)
if red and red.signals then
--local tempsignals = red.signals
for _,SignalID in pairs(red.signals) do
if SignalID.signal.type == "item" then
local name = SignalID.signal.name
--output[name]=SignalID.count // swapped from bellow to get to work on the LUA combinator, as it appears to
output[name] = rednet[name] // mix input/output somehow
if output[name] == 0 then
output[name]= nil
end
end
end
end
end
but am unsure how to intergrate this code into the combinator
or produce a GUI to select which type(s) to filter for, but as a workaroud can produce three versions, one for each type