luggage Novice
Joined: 20 Jul 2004 Posts: 38 Location: Australia
|
Posted: Sun Jul 29, 2007 8:32 am
Problem with comms script |
Having recently bought Cmud, I decided to update my scripts but got stuck when I tried to change a list of #IF statements into a #SWITCH one. The main bit is a trigger that triggers on ANSI colour output from the mud (i.e. all the talk channels which I set to 1 colour), then figure out which channel was grabbed, recolour it to my choice, then finally capture it to a seperate window and gag the output to main screen.
I'm not used to the new package editor, so don't know how to grab a trigger in its entirety out of it as with zmud, but.. the trigger pattern is %e[4;30m(%x)
For instance, this works fine:
$comm_check = %1;
#IF ($comm_check = "[SM]") {#VAR cur_colour "blue,bold"};
#IF ($comm_check = "-={Nexus}=-") {#VAR cur_colour green};
#IF ($comm_check = "[sale]") {#VAR cur_colour grey};
#IF ($comm_check = "#") {#VAR cur_colour white};
#IF ($comm_check = "[}Ladriz{]") {#VAR cur_colour yellow};
#IF ($comm_check = "*N*") {#VAR cur_colour grey};
#IF ($comm_check = "<=S=>") {#VAR cur_colour grey};
#IF ($comm_check = "*Quest*") {#VAR cur_colour grey};
#COL @cur_colour;
#CAP comms;
#GAG
However, when I tried using:
$comm_check = %1;
#SWITCH ($comm_check = "[SM]") {#VAR cur_colour "blue,bold"} ($comm_check = "-={Nexus}=-") {#VAR cur_colour green} ($comm_check = "[sale]") {#VAR cur_colour grey} ($comm_check = "#") {#VAR cur_colour white} ($comm_check = "[}Ladriz{]") {#VAR cur_colour yellow} ($comm_check = "*N*") {#VAR cur_colour grey} ($comm_check = "<=S=>") {#VAR cur_colour grey} ($comm_check = "*Quest*") {#VAR cur_colour grey};
#COL @cur_colour;
#CAP comms;
#GAG
It didn't work. It didn't even capture the text into the seperate window, or gag it. I double-checked all the brackets and stuff, and to me it looks just like the way setout in the help files. I can (and still do) use the old one, but prefer switch statements to a load of ifs.
Apart from that, the new Cmud looks very nice, and I like the docking part of it. Great work Zugg!
Luggage |
|