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
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Aug 20, 2006 1:37 pm   

#GAG/#SUB for a who list
 
Heya,

I have a who list sent by the mud that I use to populate a button.

It comes in the form
Code:
          +Guinn         
          +Blahblah         
          +Whoever         
          +Zugg         
          +Bob         


and I use
%s+(%w)%s
to match the pattern

Normally I'd just gag it, but the mud doesn't send a newline before the wholist, so I often end up gagging the last part of normal mud output that I'd want to keep.
Code:
2050 1000 >          +Guinn         
          +Blahblah         
          +Whoever         
          +Zugg         
          +Bob         


I was going to use #SUB instead to just remove the matched text but because there's a new line being sent at the end I'm getting a bunch of empty lines instead.

Can't get the pattern right to fix it, so any help much appreciated.
It's actually in CMUD 1.05, but since it's a standard trigger question I wont clog up the beta forums with it.

Cheers


Last edited by Guinn on Mon Aug 28, 2006 10:44 am; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Sun Aug 20, 2006 7:32 pm   
 
#TR {^$} {#GAG}
_________________
Discord: Shalimarwildcat
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Aug 20, 2006 8:16 pm   
 
I don't want to gag every empty line though, just those that are part of the wholist. If I put
+(%w)%s$^
as the pattern, then #sub it then it seems to confuse the second line received (I guess because it becomes a multiline capture?)
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Mon Aug 28, 2006 10:28 am   
 
Well very nearly there with

#TRIGGER {^%s !%s$} {#GAG}
#TRIGGER {^%s #%d#%d#%s$} {#GAG}
#TRIGGER {^%s +%w%s$} {#GAG}
#TRIGGER {^%s @%d@%d@%s$} {#GAG}
#REGEX {(?<!^)(\s+ !\s+$)} {#SUB {}}
#REGEX {(?<!^)(\s+ #\d+#\d+#\s+$)} {#SUB {}}
#REGEX {(?<!^)(\s+ @\d+@\d+@\s+$)} {#SUB {}}
#REGEX {(?<!^)(\s+ \+\a+\s+$)} {#SUB {}}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
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