Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Jaiven
Wanderer


Joined: 03 Oct 2007
Posts: 66

PostPosted: Sat Nov 03, 2012 11:24 pm   

Pulling a specific word from an Array
 
Hello, I am looking to set up a trigger that checks an array and does something if it hits true on a word from that array.
Example:
^ ~[ (%d) ~] ~< scraps ~> a cut of (%w)
Then I would have the value check %w in an array and if the %w matches a word it will do something. I just don't know how to make %w check the array for a specific word within it.

Thank you if you can help me out on this!
Reply with quote
shalimar
GURU


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

PostPosted: Sun Nov 04, 2012 12:41 am   
 
in your example it would be something like
#IF (%ismember(%2, @array)) {do something}

alternatively, you could put the array into the trigger pattern:

^ ~[ (%d) ~] ~< scraps ~> a cut of ({@array})
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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