This is the format of the script and $1 refers to the channel.


Code:
alias rnicks {
  var %i = 0
  while (%i < $nick($1,0)) {
    inc %i
    if $($+(%,varcheck,.,$1($nick,%i)),2) { 
      echo -a $nick($1,%i) yes
    }
    else echo -a $nick($1,%i) no
  }
}