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
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Mar 25, 2002 1:11 am   

#GAG issue with return characters
 
in both 6.16 and in 6.26a
a standard blank-line gag trigger removes the blank line:

#trigger {^$} {#gag}

a standard pattern gag trigger gags the pattern text but leaves a blank-line:

#trigger {pattern} {#gag}
#trigger {^pattern) {#gag}
#trigger {pattern$} {#gag}
#trigger {^pattern$} {#gag}

Is this genuine #GAG behavior (ie, it ignores the matched return character or otherwise generates one of its own), a bug with #GAG or the anchor character(s) processing, machine-specific, MUD-specific? I know there are a few ways to pick up the trailing blank-line, but I've noticed most of them have started to eat other lines either as part of the beta upgrade parsing faster or through the inherent delays involved with these other methods (except for the multi-gag commands).

No real reason I'm asking this, but all the answers to such questions that say #GAG can/does do this all by itself are simply frustrating me and my lack of technical knowledge. As far as I can tell, #GAG does not handle the return characters.

li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Mar 25, 2002 6:07 am   
 
Standard blank-line trigger is {$}, not {^$}. They might both work though.

Don't usually use #GAG, but I went ahead and made a trigger to remove the spam when I walked into the bank
#TR {banker says} {#GAG}
It worked fine, once I got the spaces right (2 instead of 1). Blanked the banker's standard greeting WITHOUT leaving a blank line. I have no idea why others have trouble with this.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
jkazos
Beginner


Joined: 10 Feb 2002
Posts: 14

PostPosted: Wed Apr 03, 2002 5:58 pm   
 
Why wouldn't "#trigger {$}" match *every* line, rather than just blank lines? All it says is "trigger on the left side of an end-of-line character" which, as far as I know, everything but the prompt (if one exists) has. Even then, it would trigger on the prompt as soon as a command was entered or the MUD sent more text. In the same way, shouldn't "#trigger {^}" match all the right-sides of end-of-line characters, as well as the left side of the first character in the buffer?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Apr 03, 2002 11:35 pm   
 
According to Zugg, the blank-line pattern was officially ^$ but it was totally bugged and not working until about 6.13-6.15 or so; thus everyone was using {$} instead (dunno why it presumably still works, since there's no other anchoring character; maybe it's one of them dual-purpose characters?)

li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 04, 2002 3:31 am   
 
According to the helpfile "Pattern Matching" the blank-line pattern is officially $.
quote:
To match a blank line, use the $ pattern by itself.

Don't ask me to explain why, though.

LightBulb
All scripts untested unless otherwise noted
Reply with quote
iodem
Newbie


Joined: 18 Oct 2000
Posts: 9
Location: USA

PostPosted: Sat Apr 06, 2002 6:07 pm   
 
The main problem I saw with removing the line after it is this.. on the MUDs I play we dont always get
a blank line after everything, and gagging two lines sometimes make things go unnoticed.

Iodem

Admin of Ravennar MUD
ravennar.com 4242
Reply with quote
Buba
Newbie


Joined: 01 May 2002
Posts: 0

PostPosted: Sun Apr 07, 2002 2:32 am   
 
quote:

According to the helpfile "Pattern Matching" the blank-line pattern is officially $.
quote:
To match a blank line, use the $ pattern by itself.

Don't ask me to explain why, though.

LightBulb
All scripts untested unless otherwise noted



So if this is correct then How would you Pattern match multi lines like...

You say, "Hi"

John Says, "Hi"

Would it be...
#TRIGGER {You say, "Hi"$$^John says, "Hi"$}

Just WOndering.
Reply with quote
jkazos
Beginner


Joined: 10 Feb 2002
Posts: 14

PostPosted: Sun Apr 07, 2002 3:24 am   
 
#trigger {^You say, ~"Hi~"$$John Says, ~"Hi~"$}

(I think you need to escape the quotation marks.) This is why I said that about the difference between ^$ and $ (and the ^$ trigger does work perfectly for me): The above trigger should translate to English as this.

The start of a line, followed by {You say, "Hi"} followed by the end of a line, followed by the end of a line, followed by {John Says, "Hi"} followed by the end of a line.

By logic, this should match it also. I haven't tried it, though, and if it doesn't match it, there may be an issue in the code for the matching.

#trigger {^You say, ~"Hi~"$^$^John Says, ~"Hi~"$}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Apr 07, 2002 4:16 pm   
 
Go ahead and try it then. By similar logic, this should also work:
#trigger {^You say, ~"Hi~"^^John Says, ~"Hi~"$}
and you could probably match a blank line with:
#TR {^}

I'm not going to bother testing any of this though, because I don't really care. Since the documented method works I don't feel any need to find undocumented methods of doing the same thing.

LightBulb
All scripts untested unless otherwise noted
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