Logistic Request Manager (continued)

by daeruun

Allows you to save and switch between custom logistic request presets, as well as request blueprints. Optionally presets can be pushed to constant combinators to use the circuit network to manipulate requests.

Utilities
3 months ago
0.18 - 1.1
24.6K
Logistic network

g Is there a way to add requests with infinite maximum quantity? [complete]

2 years ago

Hello. This mod is amazing and really helpful, but I found that when playing with other mods that adds a ton of items, it makes a bit cumbersome to add many requests.
What I would like is to learn how to make it a default when requesting a item, for it to be at infinity quantity, instead of 0. Is there a option somewhere?

Thank you

2 years ago

Hi ThiagoCururu,
I'm not sure if I understand what you want to achieve...
When creating a new request in the character or a chest it should by default be 'bring me at least 1 stack' and no upper limit should be configured, if I recall correctly... There was a setting somewhere to change the default minimum amount requested to 1 item or perhaps even 0, but I am not aware of a setting for the maximum...
My mod does not change anything there. It is made to save and reload those requests created in the players character or a chest (or a combinator)....

But as I said, I may have misunderstood your intention.

Feel free to come back at me in that case.

2 years ago

Sorry I was a bit tired and since english is not my first language, I now realise it was not clear.

What I want is a variation of a preset you included: "clear all"
"All items that are not listed below will be requested with a minimum of '0' and a maximum of '0'. "

The modification I'm looking for is to have the maximum quantity defaulted to infinity, so I don't throw my whole inventory to trash right away. In a game with lots of mods there's a shitload of different items, and it'll be a lot easier to specify what I do not want, than to edit ALL the remaining items.

I prefer having all items already included in logistics and keep it organised with another mod, so it's easier to request/trash something specific when needed.

To summarise, I want to create a preset like: "Include all"

"All items will be requested with a minimum of '0' and a maximum of '∞'. "

How do I create something like this?

Thank you for helping!

2 years ago

It could be done by script, I think...
I'll come up with something, but it may take some days, as I'm quite busy at the moment.

2 years ago
(updated 2 years ago)

Hey dude, no problem, just wanted some information if I could somehow create it, but since I have zero experience writing code, I prefer to wait whenever you want, or can, do it :P

The preset that made me think it would be easy to do, since it has some items defaulted to infinite quantity: https://i.imgur.com/jNErrml.jpg

Thanks for your time and contribution!

2 years ago
(updated 2 years ago)

Hi ThiagoCururu,

you may want to try this.
This will create a new set of requests in the player character. (and overwrite all current requests, so save them first, if you want to keep them.)

/c __LogisticRequestManager__ preset={}
last_subgroup = nil
preset_name="keep them all"
for _, item in pairs (game.item_prototypes) do 
    if not(item.subgroup=="other" or (item.flags and item.flags["hidden"]) ) then 
        if not (last_subgroup == item.subgroup or last_subgroup==nil) then
            slots = table_size(preset)
            if ( slots % 10 > 0 ) then  
                last_slot = slots + 10 - (slots % 10)
                for i = slots+1, last_slot do
                    preset[i] = { nil }
                end
            end
        end
        last_subgroup = item.subgroup
        table.insert(preset,{name=item.name or "", min=0, max=0xFFFFFFFF, type="item"})
    end
end
lrm.request_manager.apply_preset(game.player, game.player.character, preset, {}, "preset")

have a look at it and tell me if that is what you are looking for.
but keep in mind that, if you store this as a template, it may have an impact on performance. check for a reasonable value for 'GUI: preset-slot-updates per tick' in the player section of the mod settings!

2 years ago

I don't know how you made it that fast, but that command worked way better than I expected, because it came organized the same way as Crafting tab is. I'm just not sure if it is because I have other mod that organizes logistic requests, or it was you. The doubt is because adding one of your other presets doesn't make it so neat. https://imgur.com/a/CwOlU8z

I really appreciate all you done. Hope you have great xmas and new year! (if you celebrate these dates)

2 years ago

I did it on purpus, this time.
And it is actually just the clear all preset with Max set to inf... So I could take it from there and adapt it a little.
The format of the clear all preset is updated as well in the next update I plan. Perhaps I should also update the presets in the github wiki, but they are basically the clear all preset...

2 years ago

1.1.19 which is now on the portal contains the template from the script above and a setting as well as a command to create it ;-).

New response