Top

Peak counter for channels -___-


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 01, 2008
Last Updated  Jul 01, 2008
Tags  counter  peak  visitor 

Introduction

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. :"(

Grab the Code

;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

  (4)  RSS
napa182
Comments: 1,453
 
mIRC Snippet:  Peak counter for channels -___-
Posted on Jul 1, 2008 11:50 pm
you have a bracket missmatch
vaseline28
Comments: 160
 
mIRC Snippet:  Peak counter for channels -___-
Posted on Jul 2, 2008 1:07 am
Quote:
if (!$hget(peak)) { hmake peak }
if ($exists(peak.hsh)) { hload peak peak.hsh }

In the on *:connect and on *:load events change to:
Quote:
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.
juhapuha
Comments: 73
 
mIRC Snippet:  Peak counter for channels -___-
Posted on Jul 9, 2008 6:40 am
>.< fu*k :) I need mIRC! not nice to script at all with just a txt editor :D
Yilena
Comments: 13
 
mIRC Snippet:  Peak counter for channels -___-
Posted on Jul 31, 2008 4:03 pm
It enables and disables at once.. and gives me a whole channel list of the server :x

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom