Peak Users

By Gecko321 on Mar 30, 2008

This snippet will keep track of the total amout of users on a channel. The owner can view from the Popup, or users in the chan can type !Peak to have it sent to the chan.

Copy and paste into new remotes file. Once you or someone joins a channel it will start keeping track.

menu Channel {
  Peak Users
  .Peak  $peak($Chan):halt
}

raw 366:*:if ($nick($2,0)) && ((!$hget(peaks,$2)) || ($GetTok($hget(peaks,$2),1,32) < $nick($2,0))) { hadd -m peaks $2 $nick($2,0) $ctime }

alias -l peak {
  if ($hget(peaks,$1)) {
    tokenize 32 $v1
    return $1 ( $+ $asctime($2,mm/dd/yy) $+ )
  }
  else { return Unknown }
}

alias -l loadpeaks {
  if ($hget(peaks)) { hfree peaks }
  hmake peaks 
  if ($isfile($ScriptDirpeaks.tbl)) { hload -b peaks $ScriptDirpeaks.tbl }
}

alias -l PeakSave if ($hget(peaks)) { hsave -ob peaks $ScriptDirpeaks.tbl }

on *:EXIT:if ($hget(peaks)) { hsave -ob peaks $ScriptDirpeaks.tbl }

on *:JOIN:#:if ($Nick != $me) && ($nick($chan,0)) && ((!$hget(peaks,$chan)) || ($GetTok($hget(peaks,$chan),1,32) < $nick($chan,0))) { hadd -m peaks $chan $nick($chan,0) $ctime }

on *:CONNECT:.timerPeak 0 60 /PeakSave

on *:START:loadpeaks

on *:TEXT:!peak:#:{
  if ($Peak($Chan) != Unknown) { 
    var %temp = $v1
    tokenize 32 $v1
    .msg $chan Peaks users of $1 occurred at $mid($2,2,$calc($len($2) - 2)) $+ . 
  }
}

Comments

Sign in to comment.
Cheiron   -  Mar 08, 2009

sorry for the double post. with reference the edit for showing the time that the peak occured... could it be done that the nick that came in that made the highest figure be shown in the report or not?

 Respond  
Cheiron   -  Mar 08, 2009

how do i show what time the peak occured also with this script please. otherwise it is not a bad working script.

 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.