|
NO Xplode Newbie
Joined: 03 Dec 2007 Posts: 4
|
Posted: 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... |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
NO Xplode Newbie
Joined: 03 Dec 2007 Posts: 4
|
Posted: 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... |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: 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 |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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} |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: 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 |
|
|
|
|
|