mIRC Home    About    Download    Register    News    Help

Print Thread
#171521 25/02/07 10:12 AM
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
Let's say I'm trying to keep up how many words people speak in a chan.

This ofcourse could be easily done with:

on *:text:*:#chan: {
inc $($+(%,$2,words),1) $0
}

Now how would I be able to sort the top10 out of all those variables? Or is there a better way to store this data and get top10, top20, top14, top39 or w/e scores

tekano #171524 25/02/07 01:01 PM
Joined: Jan 2007
Posts: 280
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Erm.. I have only this:

Code:
ON *:TEXT:*<word>*:#chan:{
set %count 1
}
Else {
%inc 1
}


Dunno?

I am not a big scripter... xD

Last edited by DuXxXieJ; 25/02/07 01:02 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.
DuXxXieJ #171531 25/02/07 03:59 PM
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
You're not getting the point here.

I'm not trying to find out how many times a word is used, but I'm trying to find out how to get a "top10" talkers list.

tekano #171534 25/02/07 04:06 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Top 10 scripts have been done before. This post might be of assistance

tekano #171548 25/02/07 05:02 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If I'm reading your script the way you mean for it to be read, then your $2 should be $nick. smile

Anyhow, hash tables are a better solution than variables for such large amounts of data. You can then sort them through an hsave/filter/hget method. To see how to do that, use search on the forum and expand to about 2 years... look for posts by DaveC with the text "hash table sort" and you should find it. If not, just look for "sort" and DaveC as the poster.


Invision Support
#Invision on irc.irchighway.net
RusselB #171554 25/02/07 05:17 PM
Joined: Mar 2006
Posts: 25
T
tekano Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Mar 2006
Posts: 25
EDIT: nvm, overlooked writeini

Last edited by tekano; 25/02/07 06:28 PM.

Link Copied to Clipboard