|
|
Joined: Oct 2003
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2003
Posts: 18 |
i know its possbile to count all messages, words and characters i have seen, but is it possible to count how many each user has said?
i am currently using this as the counters:
on *:TEXT:*:*:{ /inc %count.msgs /inc %count.words $0 /inc %count.chars $len($1-) } -Baden
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
on *:TEXT:*:*:{
inc %count.msgs
inc %count.words $0
inc %count.chars $len($1-)
inc %count.msgs. $+ $nick
inc %count.words. $+ $nick $0
inc %count.chars. $+ $nick $len($1-)
} Edit: Typo
Last edited by Collective; 28/11/03 08:01 AM.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
on *:TEXT:*:#: {
/stats -i:msgs $nick
/stats -i:words $nick $0
/stats -i:chars $nick $len($1-)
}
alias stats {
if (-i:* iswm $1) {
var %thing = $gettok($1, 2, $asc(:)), %nick = $2, %value = $iif($3, $3, 1)
/inc % [ $+ [ %thing ] $+ [color:blue]] . [ $+[/color] [ %nick ] ] %value
}
else if ($prop) {
var %nick == $2
if (($prop == msgs) || ($prop == messages)) return %msgs. [ $+ [ %nick ] ]
else if ($prop == words) return %words. [ $+ [ %nick ] ]
else if ($prop == chars) return %chars. [ $+ [ %nick ] ]
else return Invalid Property
}
else /echo -s /stats: Insufficient Parameters (/stats [-i:property] <Name> [value])
}
*Untested* This should work just like yours, then to recal the values use: $stats(name).msgs ( or $stats(name).messages ) $stats(name).words $stats(name).chars EDIT: Sorry, i found an error. It highlighted in blue in the code, if you just want to change it. Either that, or just re-copy it
-KingTomato
|
|
|
|
Joined: Oct 2003
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2003
Posts: 18 |
Ok thank you both! Thanks, Baden.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Read the ammendment if you are using mine >:P
-KingTomato
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Just a FYI -- if you are seriously counting all the words, letters and lines said by every single user you encounter, I would urge you to use a hastbale. Or three actually, one for words, one for letters and one for lines.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Oct 2003
Posts: 18
Pikka bird
|
OP
Pikka bird
Joined: Oct 2003
Posts: 18 |
Are hash tables easy to retreive and stall information? Also, King Tomato i tried your code with the corrections but it did not work. Is it possible to create an .ini file and create a [SECTION] for each user and then add the amount of words, characters to it by using the /writeini commands? or can't they be added up?
|
|
|
|
Joined: Nov 2003
Posts: 67
Babel fish
|
Babel fish
Joined: Nov 2003
Posts: 67 |
iniĀ“s are very slow to do that. Try hashtables and see what simply are. You can see hashtable tutorial in www.helpdesk.zaz.net. See the globby log.
irc.universochat.net #escripting
|
|
|
|
|
|