$joined

By hixxy on Oct 18, 2005

This snippet will return the number of seconds you've been on a channel.
There are comments and examples included with the code.

/*

$joined()

Usage: $joined(#channel)

Explanation: returns the number of seconds you've been on #channel.

*/

alias joined { return $iif($calc($ctime - $hget(joined $+ $cid,$1)) < $ctime,$v1,0) }

on *:disconnect:{
  if ($hget(joined $+ $cid)) { hfree $v1 }
}
on me:*:join:#:{ hadd -m joined $+ $cid $chan $ctime }
on me:*:part:#:{
  if ($hget(joined $+ $cid,$chan)) { hdel joined $+ $cid $chan }
}

Comments

Sign in to comment.
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.