Page 1 of 1

Combinators: Unloading off train

Posted: Fri Jan 05, 2018 6:21 pm
by Ralf71
Hello,

I would like to have 3 or 4 parallel stations (with the same name) to unload trains into the bot network of my base.
At these stations different trains stop: iron and copper plates, green boards. I want to unload the current train only if there is not enough (1k?) in the chests (otherwise the less demanded resource fills up my chests)

So I need to read the content of the train (found that) and read the content of all chest (found that too), but now I need the combination for "if number of items in chest of the type of current train < a number then do some unload".

How do I compare the chest quantity of the item in the train?

Any idea? I hope you can understand what I mean to ask, if not I will try to find other words to ask...

Re: Combinators: Unloading off train

Posted: Fri Jan 05, 2018 6:52 pm
by pleegwat
Multiply the amount in the base by -1, put it on the red wire. Read the train contents on the green wire. Attach both of them to a filter inserter in set filter mode.

Re: Combinators: Unloading off train

Posted: Sat Jan 06, 2018 12:38 pm
by Serenity
The thing with wires is that connecting two signals automatically adds them. So as said above to compare two signals you multiply one of them by -1 (Each and input and output) and add it to the other. Then depending on if the result is positive or negative you can do something.