colored nick in channel - 03/03/06 07:21 PM
hi all,
Riamus made me this alias that colors the nicks I type in the room.
my question is now how to let the nick come back as a rainbow with every letter its own color.
Riamus made me this alias that colors the nicks I type in the room.
my question is now how to let the nick come back as a rainbow with every letter its own color.
Code:
alias colornicks { ; Set variables. var %c = 1,%text = $1-,%i = $gettok(%text,0,32) ; Loop through each "word." while (%c <= %i) { var %nick = $gettok(%text,%c,32) ; Remove certain symbols from the end of the current word. ; This allows you to match "Riamus" and "Riamus." for example. ; Add/Remove symbols if necessary. Note that a nick can't end in these or it won't be colored. while ($right(%nick,1) == : || $right(%nick,1) == - || $right(%nick,1) == $chr(44) || $right(%nick,1) == . || $right(%nick,1) == ! || $right(%nick,1) == $chr(63)) { var %nick = $left(%nick,-1) } ; Check if the nick is on the channel or you are in a query or chat with the nick. if (%nick ison $chan || %nick == $active) { ; Replace the nick with a colored version. ; If the nick is the first word, it will put brackets around it. Otherwise, just color it. if (%c != 1) { var %text = $reptok(%text,$gettok(%text,%c,32),$replacex($gettok($1-,%c,32),%nick,05 $+ $left(%nick,1) $+ 02 $+ $right(%nick,-1) $+ ),32) } else { var %text = $reptok(%text,$gettok(%text,%c,32),$replacex($gettok($1-,%c,32),$gettok($1-,%c,32),05 $+ $left(%nick,1) $+ 02 $+ $right(%nick,-1) $+ :),32) } } inc %c } ; Return text to calling script. return %text }