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
hoku
Newbie


Joined: 21 Dec 2001
Posts: 7
Location: USA

PostPosted: Sat Dec 22, 2001 11:18 am   

pattern matching
 
Ok. I'm trying to create a trigger so it catches a piece of text and saves it to a variable, but my mud is a little complicated. I can walk into a room and it'll say something like:

A tall slimy blob.

Now all i have to do is type: 'kill blob'. But when I fight him, it'll say something like: 'Slimy blob hits you' instead of 'A tall slimy blob hits you'. I'm trying to capture the 'Slimy blob' in 'Slimy blob hits you' and save it to a variable. I have a trigger set up like this:

#TRIGGER {(*) {bites|constricts|cleaves|slashes|bashes|pierces|claws|punches|kicks|hits} your} {#var targ %1}

But all it captures to the variable is the first word, 'Slimy'. I need to capture both words. So in the string:

Slimy blob hits your head.

I need to capture 'Slimy blob' and save it to a variable. Can you help please?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Dec 22, 2001 12:04 pm   
 
Put the %1 in quotes

#TRIGGER {(*) {bites|constricts|cleaves|slashes|bashes|pierces|claws|punches|kicks|hits} your} {#var targ "%1"}

Acaila
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