mIRC Home    About    Download    Register    News    Help

Print Thread
#62109 28/11/03 07:55 AM
Joined: Oct 2003
Posts: 18
I
Pikka bird
OP Offline
Pikka bird
I
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

#62110 28/11/03 07:59 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
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.
#62111 28/11/03 08:07 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
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
#62112 28/11/03 08:14 AM
Joined: Oct 2003
Posts: 18
I
Pikka bird
OP Offline
Pikka bird
I
Joined: Oct 2003
Posts: 18
Ok thank you both!
Thanks,
Baden.

#62113 28/11/03 08:21 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Read the ammendment if you are using mine >:P


-KingTomato
#62114 28/11/03 01:30 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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
#62115 28/11/03 02:55 PM
Joined: Oct 2003
Posts: 18
I
Pikka bird
OP Offline
Pikka bird
I
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?

#62116 28/11/03 08:58 PM
Joined: Nov 2003
Posts: 67
C
Babel fish
Offline
Babel fish
C
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

Link Copied to Clipboard