Top Ten Speaking Users

Platform:  mIRC
Published  Apr 24, 2011
Updated  Apr 24, 2011
This adds a command !top10 which shows the top ten most speaking users and the amount of words spoken.

I do realise there is a flaw with the method im using at the moment, specifically the variable size limit and I will change it to bin vars as soon as someone actually manages to hit it. on *:TEXT:*:#:{
writeini words.ini $chan $nick $calc($readini(words.ini,$chan,$nick) + $0)
if ($1 == !top10) {
var %i 1
while (%i <= $ini(words.ini,$chan,0)) {
var %w $+(%w,:,$readini(words.ini,$chan,$ini(words.ini,$chan,%i)),-,$ini(words.ini,$chan,%i))
inc %i
}
var %w $sorttok(%w,58,nr)
var %i 1
while (%i <= 10) {
var %q $gettok(%w,%i,58)
var %win %win $+(%i,.) $gettok(%q,2,45) ( $+ $bytes($gettok(%q,1,45),b) $+ )
inc %i
}
msg $chan Top ten: %win
}
}

Comments

Sign in to comment.
H0LLYWOOD   -  Oct 24, 2012
it would be nice if this was set to sort by user@host. cause after looking at the ini file. the amount of nicks that could be grouped is noteworthy.
 Respond  
ThE ViPeR   -  Feb 23, 2012
The filter command,Jethro? An the variable on line 6 is messaging to long to set.
 Respond  
[Plornt]   -  Apr 25, 2011
You know what... I actually totally forgot the filter command -.-

Thanks for the tip :)
 Respond  
Jethro   -  Apr 24, 2011
If I were you, I'd have utilized the filter command. It has the ability to sort numerically and specify the range from 1 to 10.
 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.