Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Thu Mar 02, 2006 1:06 am
#CAP, #GAG and blank lines |
Friend asked me to fix up her chat window script.
Here's the thing, she wants every thing that starts with --> to go to a diff window. Not a problem.
She wants only some of them to be #gagged in the main window. not TOO much of a problem thanks to the %begins command.
She wants in both the main mud window and chat window certain parts #subed with different colors than what are displayed. This is where I get stuck.
Another problem is that the #gag command leaves a blank line that she would like to not display in the cases of the #gags, so she's using this command:
#gag 2
But there are random times where the next line is gagged for no reason.
Nothing specific that can be recreated. Just happens on time wont the next 5 times and does again.
Code: |
#CLASS {wiznet}
#TRIGGER {^--> New Player ->} {#SUBSTITUTE {-> %ansi(high,magenta)NEWBIE ALERT%ansi(gray) ->}}
#TRIGGER {-> NEWBIE ALERT} {#CAPTURE wiznet}
#TRIGGER {^(--> *)} {
#IF (%begins( %line, "--> Possible MP:")) {#CAPTURE wiznet} {
#GAG 2
#CAPTURE wiznet
}
}
#CLASS 0
#CLASS {wiznet|MP_Warnings}
#ALIAS mptestecho {
#ECHO --> Possible MP: cheat1 and cheat2 both have I/P 12.345.6.789
#ECHO --> Possible MP: cheat1 and cheat2 both have I/P 12.345.6.789 (FLAGGED)
}
#TRIGGER {^--> (Possible MP)(: * and * both have I/P %d.%d.%d.%d)$} {#SUBSTITUTE {--> <color deeppink>%1</color>%ansi(white)%2}}
#TRIGGER {^--> (Possible MP)(: * and * both have I/P %d.%d.%d.%d)( ~(FLAGGED~))$} {#SUBSTITUTE {--> <color slategray>%1</color>%ansi(white)%2<color darkslateblue>%3</color>}}
#CLASS 0 |
and then in the wiznet window theres:
#TRIGGER {^--> (Possible MP)(: * and * both have I/P %d.%d.%d.%d)$} {#SUBSTITUTE {--> <color deeppink>%1</color>%ansi(white)%2}}
#TRIGGER {^--> (Possible MP)(: * and * both have I/P %d.%d.%d.%d)( ~(FLAGGED~))$} {#SUBSTITUTE {--> <color slategray>%1</color>%ansi(white)%2<color darkslateblue>%3</color>}}
So basically there's 2 sets of triggers doing the same thing.
Is there a way in that #if statment to say to change the colors in the main window as well as in the #cap?
I thought that if i'd set the order of the triggers to 1st do the #sub and THEN the #cap it would send the #sub'd version to the #capture but it didn't.
From my experiments it seems that
#SUBSTITUTE {--> %ansi(grey)%1%ansi(white)%2%ansi(blue)%3}
will work with the setting of trigger order
But this one does not.
#SUBSTITUTE {--> <color slategray>%1</color>%ansi(white)%2<color darkslateblue>%3</color>}
looks like the #cap and <color> settings don't co-exist
If nothing else she can just get used to good old ansi grey and blue :-)
But mainly I'd really like to get the #if to do it all. 1 trigger as opposed to 3 |
|