Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Jun 05, 2008 4:31 am   

[2.25] New line and gags
 
I could be wrong, but the following code should work, I would think:

#REGEX {^\*\*NOTE: This is NOT the same as a 'keepflag that\s+\n\s+allows you to save items usually too high level.} {#gagspace}

However, all it does is gag the second line and still displays the first line. So, I change it to:

#REGEX {^\*\*NOTE: This is NOT the same as a 'keepflag' that\s+\n\s+allows you to save items usually too high level.} {#gag -1}

and all it does is gag the first line and not anything after the \n. I have even changed it to just #gag, and it only gags the second line again. The only thing that's worked is this:

#REGEX {^\*\*NOTE: This is NOT the same as a 'keepflag' that\s+\n\s+allows you to save items usually too high level.} {#gag -1;#gag}

Why should I have to have two #gags in there? Seems to me a bug, and I might as well just create two separate triggers.

Charneus
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Jun 05, 2008 9:15 am   
 
I'd guess you need two gags because it's two lines on the screen. The #gag command doesn't know how many lines the trigger that's calling it matched, it just knows "remove the most recent line from the buffer". If you did it this way (which I prefer):

#regex {#REGEX {^\*\*NOTE: This is NOT the same as a 'keepflag that} {#gag}
#cond {allows you to save items usually too high level.} {#gag} {within|param=1}

You'd need two gag commands for the same reason.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Thu Jun 05, 2008 1:34 pm   
 
Code:
#regex {#REGEX {^\*\*NOTE: This is NOT the same as a 'keepflag that} {#gag}
#cond {allows you to save items usually too high level.} {#gagspace} {within|param=1}


Or even this, which would accomplish what you origionally set out to do.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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