Code:
on ^*:quit:{
  if ($1-) var %reason = ( $+ $1- $+ )
  var %i = 1
  while ($comchan($nick,%i)) {
    set -u10 %countnickz $calc($nick($comchan($nick,%i),0,a) - 1)
    echo $color(quit) -ti2 $ifmatch *** D3m0nicChaos Quits:8 $nick 12( $+ $address $+ ) %reason 15 $calc($nick($comchan($nick,%i),0,a) - 1) $iif((%countnickz == 1),4Chatter,4Chatters)
    inc %i
  }
  halt
}


thats what i used to make it count in my script ....... maybe its alil different than yours but i like mine as it takes in account saying your possibly the only one in the channel and changes the following from plural to singular ...... but then again thats just my taste in things also this can be modified to work with joins parts and kicks and every other event u wanna remodify ...... it then gives a count of users at the traling end of each one ..... nice neat and clean