arkayenro / arkinventory

A World of Warcraft Inventory mod for Retail, Burning Crusade, and Classic
108 stars 14 forks source link

Nested rules, or "Can one rule call another?" #1796

Open dannypike opened 1 year ago

dannypike commented 1 year ago

Thank you for maintaining this addon; it's the most useful one of them all!

My question is: Is there a rule() function that invokes another rule by ID?

I have lots of alts with different combinations of professions and I would like to be able to set up a single ArkInventory profile that adjusts the contents of bars accordingly. Having to edit multiple different profiles for each alt is too much work when I see a new item.

If I could have a rule that manages this (effectively creating a custom Periodic Table), then this would make the process much easier.

For example:

If I have a rule 1011: name("Item1", "Item2", "Item3")

and have two bags:

Bar 1: profession("Mining") and rule(1011) Bar 2: not profession("Mining") and rule(1011)

then Item1 will be placed on Bar 1 for alts that are miners and Bar 2 for alts that are not.

If I then encounter a new item that is a "mining item" that I want to behave in the same way, I only need to modify the single rule 1011. All alts will automatically cope with this item. I only have a single profile and everything is automatic.

Would it be possible to do this or, even better, is there already a way that I haven't seen?

Many thanks.

arkayenro commented 1 year ago

sorry, theres no way to stack rules

its not great but you could just assign each skill to a bar in the same row so that the items end up in the same place for each alt.

dannypike commented 1 year ago

Sorry, but I don't understand how that would help me? I want the items to be in different places, not the same place. and I would like those "different" places to be defined by another attribute, e.g. profession.

How hard would it be to add a rule that calls other rules? Would I be able to do that from a custom rule (I've just seen that this is possible)?

Thanks