Signal Class Filtering Combinator

This is the place to request new mods or give ideas about what could be done.
Post Reply
firebladed3
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Jun 30, 2017 5:22 pm
Contact:

Signal Class Filtering Combinator

Post by firebladed3 »

following on from viewtopic.php?f=18&t=79206#p470859

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
i can duplicate an combinator decider/arithmetic to keep input and output seperate, and can display the filtered type on the combinator

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

Post Reply

Return to “Ideas and Requests For Mods”