About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: 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!
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: 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.
Reply with quote
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: 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'.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Jul 15, 2009 7:59 pm   
 
#IF (%ismember(%word(%2,%i), @poisontypes) OR %match(%word(%2,%i), %d))
_________________
Discord: Shalimarwildcat
Reply with quote
herme
Beginner


Joined: 02 Mar 2009
Posts: 14

PostPosted: Wed Jul 15, 2009 8:36 pm   
 
Thank you, that worked wonders! :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net