Code:
alias clearcnicks {
  var %i = $cnick(0)
  while %i {
    if $cnick(%i) && $v1 != $!me { cnick -r $v1 }
    dec %i
  }
}
  • if $cnick(%i) && $v1 != $!me { cnick -r $v1 }
This line check first if the entry is a nickname, if it is then checks if it is not "$me". iF BOTH are true the entry is removed.
"$!me" evaluates to "$me" in the if check, where using "if $v1 != $me" would check the entry against your nick.