Expression to test for item in inventory.

Unofficial support for the creating and editing of metas.
Singlar
Posts: 6

Expression to test for item in inventory.

Post #1 »

I was surprised when I saw how big the legendary key meta was until I realized the item detection didn't allow for regular expressions. This forces a bunch of messyness around dealing with the types of legendary keys. With expressions this can be fixed. I'm sure there is a better way of doing this but it works:

iif[getobjectinternaltype[wobjectfindininventorybynamerx[Legendary Key]]==7,1,0]

This will return true if you still have at least one item matching .*Legendary Key.* in your inventory.

yaroz
Moderator
Posts: 129

Post #2 »

I did something like this for contacts and put it in the expressions thread. I used the isfalse[] expression to check to see if there were contracts in the pack.

User avatar
HellsWrath
Site Admin
Posts: 389

Post #3 »

That would also catch quest Legendary Keys and cause problems if you have any still in your pack while using the normal Aged/Durables. You would have to add additional checks.

The current meta isn't "messy" in its name detection. It uses specific names "Aged/Durable" which cannot be triggered by any other key type, and uses Aged keys first to clear your packslots the fastest so the macro doesn't try to loot items it doesn't have room for when you first begin.

You may be able to do it by template if Aged and Durables are different than Quest Legend Keys

Singlar
Posts: 6

Post #4 »

I meant no offence.

I wasn't aware the keys from quests could only be used in the chests in the dungeons. You can search for specific patterns:

iif[getobjectinternaltype[wobjectfindininventorybynamerx[\^\(Aged\|Durable\) Legendary Key\$]]==7,1,0]

Though that doesn't take care of the use order.

Singlar
Posts: 6

Post #5 »

Apparently while istrue won't work on checking for object existence, isfalse will.

isfalse[wobjectfindininventorybynamerx[\^\(Aged\|Durable\) Legendary Key\$]]

User avatar
HellsWrath
Site Admin
Posts: 389

Post #6 »

Legendary Quest Keys have a 24hr expiration timer, and the chests at the end of Legendary Quests have Luck applied. It is why they are specific weapon/armor/magic chests and not generic like the ones in arwic.

I haven't taken the time to re-write the key meta since it functions exactly as expected without changes.

There are 1001 ways to approach any given task in meta, that is the beauty of it.