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
NO Xplode
Newbie


Joined: 03 Dec 2007
Posts: 4

PostPosted: Mon Dec 03, 2007 5:11 am   

Capturing Text that maay or may not be there
 
How do I do a trigger where it's something like this

#TR {something scan something} {scan}

scan will alays be there, but anything can be before it or after it or it can just be the word it self...
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Dec 03, 2007 5:37 am   
 
Try this

#TR {* scan *} {scan}

The star acts as a wildcard. If it's just one word, then this would work better.

#TR {%w scan %w} {scan}
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Dec 03, 2007 1:29 pm   
 
Tech wrote:
#TR {* scan *} {scan}

If you're not capturing them, you don't need to include stars at the beginning and end of trigger patterns. It's identical in function to

#tr { scan } {scan}

but it'll match slower. It's also pretty much identical to

#tr {scan} {scan}

if you want a slightly less-specific match.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
NO Xplode
Newbie


Joined: 03 Dec 2007
Posts: 4

PostPosted: Mon Dec 03, 2007 3:40 pm   
 
I guess I should've been more specific....
so like it'lll be
Someone tells the group, 'scan, in entish'
Someone tells the group, 'something scan'

I want it to scan on each of those and even if they just ask scan...
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Dec 03, 2007 6:48 pm   
 
#TR {tells the group, '(*)scan(*)'} {scan}
That will scan on any group tell with scan mentioned in it.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Dec 03, 2007 6:58 pm   
 
This is probably more what you want then... assuming it's always someone telling the group.

Code:
#TR {^Someone tells the group * scan} {scan}


Try that.
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Dec 03, 2007 11:02 pm   
 
Ralgith's trigger captures and doesn't need to, but that won't hurt. Tech's trigger fails to match if the "scan" is at the start of the tell. I'd use a combination of the two:

#trig {tells the group, '*scan} {scan}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Dec 03, 2007 11:33 pm   
 
Tthat works, I'm just used to always capturing grin :)
Usually because I put limitations on my triggers.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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