mIRC Home    About    Download    Register    News    Help

Print Thread
#171521 25/02/07 10:12 AM
T
tekano
tekano
T
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

#171524 25/02/07 01:01 PM
D
DuXxXieJ
DuXxXieJ
D
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.
#171531 25/02/07 03:59 PM
T
tekano
tekano
T
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.

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

#171548 25/02/07 05:02 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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.

RusselB #171554 25/02/07 05:17 PM
T
tekano
tekano
T
EDIT: nvm, overlooked writeini

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

Link Copied to Clipboard