|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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 |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Aug 20, 2006 7:32 pm |
#TR {^$} {#GAG}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
|
|