|
glo Newbie
Joined: 01 May 2002 Posts: 7
|
Posted: Thu May 09, 2002 7:56 pm
Triggering on lines of text that contain @ |
I have a trigger with a pattern of:
^(*)$
Inside the trigger I try to store the entire line of text into a variable:
lastlineoftext01={%1}
This seems to simply ignore lines of text from the mud that contain @.
I thought about trying: lastlineoftext01={%literal( %1)}
but I figure that this will just set the variable equal to %1 when I really want the contents of %1.
Any suggestsions?
Thanks! |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu May 09, 2002 8:59 pm |
Try using:
%quote("%1")
Kjata |
|
|
|
glo Newbie
Joined: 01 May 2002 Posts: 7
|
Posted: Thu May 09, 2002 9:13 pm |
I tried that without success...
My attempt was:
lastlineoftext01=%stripansi( %quote( {%1}))
It seems like the trigger does not even fire on the line of text at all.
Do I need to change something in the pattern? Currently: ^(*)$
Any other ideas? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu May 09, 2002 10:48 pm |
I believe you need %* to match special characters. I've never seen this documented anywhere but it's mentioned frequently in this forum.
LightBulb
Vague questions get vague answers |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu May 09, 2002 11:07 pm |
When using %* to capture special characters I recommend you do it in 1 of three fashions. I will list them in order of safety...
#TR {^(%*)$} {blah;blah;#VAR capturedline %quote(%trigger);blah;blah}
#TR {^&%*{capturedline}$} {blah;blah;#VAR capturedline %quote(@capturedline);blah;blah}
#TR {^(%*)$} {blah;blah;#VAR capturedline %quote(%param(1));blah;blah}
The first works off the trigger predefined variable and hence avoids some problems with mismatched "'s that can occur. The second captures the raw line from the mud to a variable, and avoids most all problems that special characters can cause. The third is the method that Zugg recommended a while ago.
I use the second myself. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri May 10, 2002 1:29 am |
It's documented in the help file, but not somewhere you'd think to look. It's in the help entry for the #ONINPUT command.
Kjata |
|
|
|
|
|