Jethro commented on a Page, Part Message And Counter  -  Jun 09, 2010

You overlooked a couple of factors:

  1. You don't want to count the client that runs the code by adding an exclamation mark in front of that part event.

  2. If the same person parts repeatedly, it'll keep on counting. You should use a dynamic variable to identify who has parted and count the time exclusively for that user.

In fact, I think it's best to use hash tables for the counting task:

on *:start:loadcounter
on *:connect:loadcounter
on *:exit:hsave -o counter counter.hsh
on *:disconnect:hsave -o counter counter.hsh
alias -l loadcounter {
  if $isfile(counter.hsh) && !$hget(counter) { 
    hmake counter 100
    hload counter counter.hsh 
  }
}
on !*:part:#:{
  hinc -m counter $nick
  msg # Everyone, $nick has partted the $ord($hget(counter,$nick)) time!
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.