Top Ten Speaking Users

By [Plornt] on 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


Sign in to comment.
dma   -  Nov 01, 2018

how do you re-set it for every month????

dma   -  Sep 10, 2018

I dont think it's that bad... it serves it's purpose since it was never updated

ovelayer   -  Jun 14, 2014

i get line to long on line 6

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.

ThE ViPeR   -  Feb 23, 2012

The filter command,Jethro? An the variable on line 6 is messaging to long to set.

[Plornt]   -  Apr 25, 2011

You know what... I actually totally forgot the filter command -.-

Thanks for the tip :)

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.

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.