# cstrip v1.00 (c) copyright 1996 Ananda and fiend, all rights reserved. # ---------------------------------------------------------------------- # sick of all those lame mirc color codes? this will strip them : this script is kinda bare when it displays a stripped line... you can : change all the ONs to match what your script would normaly display, or : even hack your script into running $ccstrip() when it processes : publics and everything : if you use any of this in your script, give proper credit to me and : fiend huh? its only fair. # --------------------------------------------------------------------- # strip all of the color codes out of a string alias ccstrip { @ cc.ostr = [$0-] @ cc.max = [$@cc.ostr] @ cc.str = [] @ cc.cnt = 0 while (cc.cnt <= cc.max) { @ cc.ch = mid($cc.cnt 1 $cc.ostr) if ([$cc.ch] == []) { @ cc.cnt = cc.cnt + 1 @ cc.ch = mid($cc.cnt 1 $cc.ostr) if (([$cc.ch] >= 0) && ([$cc.ch] <= 9)) { @ cc.cnt = cc.cnt + 1 @ cc.ch = mid($cc.cnt 1 $cc.ostr) if (([$cc.ch] >= 0) && ([$cc.ch] <= 9)) { @ cc.cnt = cc.cnt + 1 } if ([$mid($cc.cnt 1 $cc.ostr)] == [,]) { @ cc.cnt = cc.cnt + 1 @ cc.ch = mid($cc.cnt 1 $cc.ostr) if (([$cc.ch] >= 0) && ([$cc.ch] <= 9)) { @ cc.cnt = cc.cnt + 1 @ cc.ch = mid($cc.cnt 1 $cc.ostr) if (([$cc.ch] >= 0) && ([$cc.ch] <= 9)) { @ cc.cnt = cc.cnt + 1 } } } } }{ @ cc.str = [$cc.str$cc.ch] @ cc.cnt = cc.cnt + 1 } } @ function_return = [$cc.str] ^assign -cc.ch; ^assign -cc.cnt;^assign -cc.max ^assign -cc.ostr;^assign -cc.str } on ^public "* % **" { echo <$0> $ccstrip($2-) } on ^public_msg "* % **" { echo <$0> $ccstrip($2-) } on ^public_other "* % **" { echo <$0> $ccstrip($2-) } on ^action "* % **" { echo * $0 $ccstrip($2-) } on ^topic "* % **" { echo *** $0 changed topic on $1 to $ccstrip($2-) }