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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
radboi22
Novice


Joined: 19 Jan 2008
Posts: 30

PostPosted: Wed May 05, 2010 10:08 pm   

How to check for a word in a String of words.
 
Example. You hold a Red Flute.
You hold a Flute that is Red.
You touch a Flute.
Hey there's a flute in your hand!

How do I make a trigger that looks for the Word Flute in these lines.

Basically, I hold something, and I want to trigger a trigger if it contains flute in it, but the line of words Vary's.
THANKS SO MUCH!
Reply with quote
shalimar
GURU


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

PostPosted: Wed May 05, 2010 10:40 pm   
 
You could make a trigger to fire on all those outputs like so:

#TR {{You hold a Red Flute.|You hold a Flute that is Red.|You touch a Flute.|Hey there's a flute in your hand!}} {do something}

P.S. Questions should go into the general zMUD or CMUD forums, the 'Finished MUD Scripts' section is for completed scripts to be shared with others, not for asking questions.
_________________
Discord: Shalimarwildcat
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu May 06, 2010 2:28 am   
 
If you are interested in nothing but the word Flute, you can use %qFlute%q as your pattern. The %q will force the trigger to not match on bigger words that contain Flute.
_________________
EDIT: I didn't like my old signature
Reply with quote
radboi22
Novice


Joined: 19 Jan 2008
Posts: 30

PostPosted: Thu May 06, 2010 5:29 am   
 
Thank you that's what I was looking for =D
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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