Peak counter for channels -___-

By juhapuha on Jul 01, 2008

This script will keep the record of visitors on a channels.
When user joins and the count of users is bigger than the peak for channel it will be displayed to the channel, the peak for the channel is also possible to get by using !Peak.

I decided to add popup menu to keep list of the channels where this script should work, delete channels and add.

Sorry if there's mistake(s) i can't use mirc to test. :"(

;Peak by shitbreak
;Use rightclick -> peak to see the available options
on *:load:{
if (!$hget(peak)) { hmake peak }
if ($exists(peak.hsh)) { hload peak peak.hsh }
}
on *:connect:{
if (!$hget(peak)) { hmake peak }
if ($exists(peak.hsh)) { hload peak peak.hsh }
}
on *:disconnect:{
if ($hget(peak.hsh)) { hsave peak peak.hsh }
}
menu channel {
...Peak:{
..Enable the peak for $chan $+ :{
if (!$hget(peak,$chan)) { hadd peak $chan $date $time $me $nick($chan,0) }
echo 2 -a The peak for channel $chan has now been enabled.
}
..Disable the peak for $chan $+ :{
if ($hget(peak,$chan)) { hdel peak $chan }
echo 2 -a The peak for channel $chan has now been disabled. 
}
..List the peak channels:{
if ($hfind(peak,*,0,w) == 0) { echo 2 -a The list of the channels is empty }
if ($hfind(peak,*,0,w) > 0) {
var %i = 1
while (%i <= $hfind(peak,*,0,w)) {
var %k = %k $+ $chr(44) $hfind(peak,*,%i,w)
inc %i
}
if (%k) { echo 2 -a The list of the channels: $right(%k,-1) }
}
}
}
on *:text:!peak:#:{
if (!$hget(peak,$chan)) { notice $nick The peak for channel $chan hasn't been enabled. }
else {
msg $chan Peak record: $gettok($hget(peak,$chan),4,32) - made by: $gettok($hget(peak,$chan),3,32) - made on: $gettok($hget(peak,$chan),1-2,32) ( $+ $duration($calc($ctime - $ctime($gettok($hget(peak,$chan),1-2,32))) ago.)
}
}
on *:join:#:{
if ($hget(peak,$chan)) {
if ($nick($chan,0) > $gettok($hget(peak,$chan),4,32)) {
msg $chan New peak record of $nick($chan,0) by: $nick
}
}
}

Comments

Sign in to comment.
taz901   -  Feb 12, 2012

the +peak doesn't trigger :P

 Respond  
hxck   -  Jul 31, 2011

--

 Respond  
RicJames   -  Mar 20, 2010

The script is wrecked when u right click in the chan instead of showing the menu like it's supposed to it shows part of the script code.

 Respond  
Yilena   -  Jul 31, 2008

It enables and disables at once.. and gives me a whole channel list of the server :x

 Respond  
juhapuha   -  Jul 09, 2008

.< fu*k :) I need mIRC! not nice to script at all with just a txt editor :D

 Respond  
vaseline28   -  Jul 02, 2008

if (!$hget(peak)) { hmake peak }
if ($exists(peak.hsh)) { hload peak peak.hsh }
In the on :connect and on :load events change to:
if (!$hget(peak)) hmake peak
else hload peak peak.hsh
Instead of checking twice, it skips straight to the next bit, making it faster.
Taking out the brackets also makes it faster.

 Respond  
napa182   -  Jul 01, 2008

you have a bracket missmatch

 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.