Page 1 of 1

Need help for another bot mall feature

Posted: Mon Feb 03, 2025 4:49 pm
by Puppet
Hi engineers ! You may have seen my first post about the bot mall I'm building, this time I got another issue.

The light colour system works really fine and allow me to add multiple colour indications, but the computer is taking quite some place and I thought about others uses from it. In particular a parametrized limit for each items that the mall is producing. Since the computer needs a "items limits bank" input by a constant combinator I believed it could be possible to use that constant combinator to modify every limits there are in the bot mall.

Limit are put in place like this, simply the inputting inserter reads the storage chest items and compare it to a value which is the item limit. That item limit in particular could I believe be controlled by the computer too with something like this :
Express belt adding up to 2100 (top right)
Express belt adding up to 2100 (top right)
image_2025-02-03_174429245.png (66.67 KiB) Viewed 281 times
However if I take express belt for example, I would like the constant combinator to output signal "express belt 2000" to the bulk inserter and the storage chest to have like 100 express belts in it, the inserter then compares two values and know if it should be turned on or not. But since both signals are express belt they add up and I can't make this system work :
Basic idea I had
Basic idea I had
image_2025-02-03_174807729.png (272.73 KiB) Viewed 281 times
I then ask if someone could figure out a solution to this problem (preferably without using combiner deciders or calculators), just to inform, the actual computer only output packedRGB items values so I don't think they are usable for what I want to do with bulk inserters. Thanks if you can help me !

Re: Need help for another bot mall feature

Posted: Mon Feb 03, 2025 6:48 pm
by Tertius
In my automated mall, I maintain these lists (among others):
  • A: item demand (what items I want to have available; defined in some constant combinator)
  • B: item requests: list of item requests (read roboport 1: logistic network requests. Includes player personal logistic requests.
  • C: item stock: list of existing items (read roboport 2: logistic network content. Every item is either in the logistics network or doesn't exist)
From these, I compute the list of items to craft, which is demand + requests - inventory. Or actually negated to have missing items appear as negative:
  • D: list of items to craft: D := C - (A + B) (negative numbers: need to craft; positive number: surplus)
Can be done with one arithmetic combinator directly. Wire A and B together with green wire, results in AB := A+B. Then wire AB with green wire and C with red wire to an arithmetic combinator. Set EACH(red) - EACH(green). Output is EACH, resulting in list D.

You can also multiply AB with -1 with the arithmetic combinator instead, then add to C by wire. Depends on how you need your lists and lists derived from them.

An inserter activation condition can then be configured with a simple (item) < 0. Everywhere. Always compare against 0.

In case you don't want the mall automatically start if some logistic request comes up, omit list B. But it's quite nice to request a rocket silo from your player inventory, and one minute later it pops up in your inventory, without adjusting any constant combinator.

Re: Need help for another bot mall feature

Posted: Tue Feb 04, 2025 10:18 am
by Puppet
Thank you really much @Tertius, I'll try to sort this out and make the mall work like I intended ! (Plus it could add other useful functionalities I believe)