I think this will do what you want:
Code:
alias -l cc {
  var %c = 1
  while ($comchan($me,%c)) {
    return $v1
    inc %c
  }
}
on *:input:*:{
  if ($left($1,1) !isin / $readini($mircini,text,commandchar)) && (!$ctrlenter) && (!$inpaste) {
    var %c = $regsubex($str($chr(32),$nick($cc,0)),//g,$nick($cc,\n)), %x = $numtok(%c,32), %t = $1-
    while (%x) {
      var %r = $gettok(%c,%x,32), %t = $replace(%t,%r,$+($chr(2),%r,$chr(2)))
      dec %x
    }
    say %t
    haltdef
  }
}
There's a chance that the script may run into an issue if you have a big channel with 100+ people. But for a small channel, this should work a treat. I'm not certain how many tokens are allowed in a local variable before it triggers an error or gets cut off.

Last edited by Tomao; 13/06/11 12:20 AM.