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


Joined: 01 May 2002
Posts: 7

PostPosted: 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!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu May 09, 2002 8:59 pm   
 
Try using:
%quote("%1")

Kjata
Reply with quote
glo
Newbie


Joined: 01 May 2002
Posts: 7

PostPosted: 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?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
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