Since everyone is making suggestions, I can't stay behind

The condition in an if/while evaluates to $true for everything but 0, $null and $false, and since you can't join channel 0 (even though some people tell you you can

) it goes over all channels. Then use $v1 to use the channel in the loop...
I also found out the notice isn't being shown if you use raw, so I put in some echo's and hid the raw display in $active.
anotice {
var %n = 1, %n1
while ($chan(%n)) {
var %n1 = %n1 $+ , $+ $v1
echo $color(notice) $v1 $+(-,$me,:,$v1,-) $1-
inc %n
}
.raw notice $right(%n1,-1) : $+ $1-
}