|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: Wed Jul 15, 2009 6:15 pm
[3.08] Having trouble getting trigger to recognize a number |
Code: |
pattern: (%w) says loudly*"brew (*)"
#loop %numwords(%2) {
#if (%ismember(%word(%2,%i),{@potiontypes|%d})) {
#echo success
}
} |
What I'm trying to do is make a trigger that triggers when someone says for example 'brew 10 mana 6 int' but I'm only getting the success trigger on the words that are in the @potiontypes string list, none of the numbers trigger it. Can someone help me out with what I'm doing wrong? Thanks! |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Wed Jul 15, 2009 6:57 pm |
Don't think that %d is valid for trying to match to anything. As I understand this, you want it to loop through the "brew 10 mana 6 int". Are you wanting it to match anything in @potiontypes or a number?
I mean 'or' as in it matches either a potion type or a number, not just one of the two. |
|
|
|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: Wed Jul 15, 2009 7:29 pm |
Yeah, I want it to match either a potiontype or a number, as long as it matches one of them. Any number is fine but only one of the potiontypes for 'words'.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Wed Jul 15, 2009 7:59 pm |
#IF (%ismember(%word(%2,%i), @poisontypes) OR %match(%word(%2,%i), %d))
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
herme Beginner
Joined: 02 Mar 2009 Posts: 14
|
Posted: Wed Jul 15, 2009 8:36 pm |
Thank you, that worked wonders! :)
|
|
|
|
|
|