getMatchingLibProperties() doesn't seem to work ;(

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
celestian
Dragon
Posts: 276
Joined: Mon May 17, 2010 3:29 pm

getMatchingLibProperties() doesn't seem to work ;(

Post by celestian »

So while doing some other searching I ran across getMatchingLibProperties and decided to see how it works. Wrote a short little script like this.

Code: Select all


[h: matches = getMatchingLibProperties("dbIdxTag.*","Lib:Spells")]

Matches = [r: matches]<br>

[foreach(item,matches,","), code :{
	Item = [r:item]=([r: getLibProperty(item,"Lib:Spells")]<br>
}]
However, I get nothing. I know that the vars are there because dbIdxTag.Arcane.SpellName is the format I use for all my "arcane" spells and they exist.

I thought maybe it was my regex but I tried "dbIdxTag*" and no joy. Is there some odd trick I'm missing here? Even using the getAllPropertyNames() doesn't list them.

User avatar
celestian
Dragon
Posts: 276
Joined: Mon May 17, 2010 3:29 pm

Re: getMatchingLibProperties() doesn't seem to work ;(

Post by celestian »

So turns out I was being an idiot.

Code: Select all

[h: tag = lower(getLibProperty("ItemTag","Lib:Spells"))]

Getting all matches of [r: tag].*<br>

[h: matches = getMatchingLibProperties(tag+".*","Lib:Spells")]

[foreach(item,matches,","):item]
Somewhere along the line I was using "lower" on the tag name or something. That said, boom stack overflow every time I try to do anything with the list other than just what I have above.

Code: Select all

[foreach(item,matches,""), code:{
 Item = [r:item]<br>
}]
So I guess not to good to use for big DB stuff? I am thinking I might use it on player tokens for much smaller number of results.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: getMatchingLibProperties() doesn't seem to work ;(

Post by wolph42 »

the stack overflow if probly due to an error that generates LOTS of text, porting that text to the chat gerenates a stack overflow. What you can try:
- raise the stack to something ridiculous like 20 to see what the error is
- remove the loop and only check the first entry
- hide the loop [h,] and check the console to see what the error is (see debug article linked in in sig.)

Post Reply

Return to “Macros”