Using zeropadded parameters in $rand() won't make it return a zeropadded value too. You get away with the first $rand() (as it's impossible to have a nick that begins with a number) but the second $rand() could mess up. You'd need $base($rand(0,15),10,10,2). Also, $rand() could return the background colour of the user, meaning that at least half of the nickname would be invisible. Last, using it on 1-letter nicks would return <ctrl+k>N1<ctrl+k>N2<nick>, ie unnecessary colour codes.

Here's an alias that deals with these problems and also makes sure that the random colours will not be the same:
Code:
alias rc {
  var %a = $remtok(00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15,$color(b).dd,32), $&amp;
    %1 = $gettok(%a,$r(1,15),32)
  if ? iswm $1 { return $+($chr(3),%1,$1,$chr(3)) }
  var %2 = $gettok($remtok(%a,%1,32),$r(1,14),32), %a = $int($calc($len($1) / 2))
  return $+($chr(3),%1,$left($1,%a),$chr(3),%2,$right($1,- $+ %a),$chr(3))
}


Edit: bah, while I was previewing my post, littlecramp clarified that it's for the nicklist. I wrote this in vain ...and I can't even sell it.

Last edited by qwerty; 16/07/03 04:42 PM.