Here you go
on *:text:!*count*:#: {
$InfoTracker($event,$nick,$chan,$0)
if ($mid($1,2,1) = h) {
msg $chan Options are W (text), E (emote), J (join), P (part), Q (quit)
msg $chan Options are NI (nick), NO (notice), H (for help)
msg $chan The top 3 can be found using above except use top or topc for the top 3 list.
msg $chan Example: !wcount or !wcount nick , !<letter(s)>count topc/top
}
var %person $iif($2,$2,$nick)
if ($istok(w e j q p,$mid($1,2,1),32)) {
var %letter $replace($mid($1,2,1),e,Action,w,Text,j,Join,q,Quit,p,Part)
if ($istok(top topc,$2,32)) { $InfoTrackerTop(%letter,$2,$chan) }
else {
if ($left($2,1) != $chr(35)) { msg $chan %letter count for $qt(%person) is $comma($iif($hget(IT $+ %letter,%person),$v1,0)) }
if ($left($2,1) == $chr(35)) { msg $chan %letter count for $qt(%person) is $comma($iif($hget(ITC $+ %letter,%person),$v1,0)) }
}
}
if ($istok(ni no,$mid($1,2,2),32)) {
var %letter $replace($mid($1,2,2),ni,Nick,no,Notice)
if ($istok(top topc,$2,32)) { $InfoTrackerTop(%letter,$2,$chan) }
else {
if ($left($2,1) != $chr(35)) { msg $chan %letter $iif($mid($1,2,2) = ni,change) count for $qt(%person) is $comma($iif($hget(IT $+ %letter,%person),$v1,0)) }
if ($left($2,1) == $chr(35)) { msg $chan %letter $iif($mid($1,2,2) = ni,change) count for $qt(%person) is $comma($iif($hget(ITC $+ %letter,%person),$v1,0)) }
}
}
}
; $InfoTrackerTop($1,$2,$chan)
; $1 = %letter , $2 = top or topc
alias InfoTrackerTop {
var %top $iif($2 = topc,ITC,IT) $+ $1
var %d = 1 | window -hn $+(@,%top)
while $hget(%top,%d).item { aline $+(@,%top) $v1 $hget(%top,$v1) | inc %d }
filter -cteuww 2 32 $+(@,%top) $+(@,%top)
msg $chan $+([,$1,]) $&
[1] $iif($line($+(@,%top),1),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[2] $iif($line($+(@,%top),2),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[3] $iif($line($+(@,%top),3),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None)
msg $chan $+([,$1,]) $&
[4] $iif($line($+(@,%top),4),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[5] $iif($line($+(@,%top),5),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[6] $iif($line($+(@,%top),6),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None)
msg $chan $+([,$1,]) $&
[7] $iif($line($+(@,%top),7),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[8] $iif($line($+(@,%top),8),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None) $&
[9] $iif($line($+(@,%top),9),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None)
msg $chan $+([,$1,]) $&
[10] $iif($line($+(@,%top),10),$gettok($v1,1,32) $comma($gettok($v1,2,32)),None)
window -c $+(@,%top)
}
;Usage: $comma(number)
alias comma {
var %a, %b = $regsub($ticks,$$1,/\G([+-]?\d+?)(?=(?:\d{3})++(?=\.\d++$|$))/g,\1 $+ $chr(44),%a)
return %a
}
on *:text:*:#: { $InfoTracker($event,$nick,$chan,$0) }
on *:action:*:#: { $InfoTracker($event,$nick,$chan,$0) }
on *:notice:*:*: {
hinc -m IT $+ $event $nick $0 | InfoTrackerSave
var %t 1 | while $comchan($nick,%t) { $InfoTracker($event,$v1,$0) | inc %t }
}
on *:part:*: { $InfoTracker($event,$nick,$chan) }
on *:join:*: { $InfoTracker($event,$nick,$chan) }
on *:quit: {
hinc -m IT $+ $event $nick 1 | InfoTrackerSave
var %t 1 | while $comchan($nick,%t) { $InfoTracker($event,$v1) | inc %t }
}
on *:nick: { $InfoTracker($event,$nick) }
; Usage: $InfoTracker($event,$nick,$chan,$0)
alias InfoTracker {
if ($1 = nick) { hinc -m IT $+ $1 $2 1 }
if ($1 = notice) { hinc -m ITC $+ $1 $2 $3 }
if ($istok(text action,$1,32)) { hinc -m IT $+ $1 $2 $4 | hinc -m ITC $+ $1 $3 $4 }
if ($istok(join part quit,$1,32)) {
if ($istok(join part,$1,32)) { hinc -m IT $+ $1 $2 1 | hinc -m ITC $+ $1 $3 1 }
if ($1 = quit) { hinc -m ITC $+ $1 $2 1 }
}
InfoTrackerSave
}
alias InfoTrackerSave {
hsave ITtext ITtext.hsh | hsave ITquit ITquit.hsh
hsave ITjoin ITjoin.hsh | hsave ITnotice ITnotice.hsh
hsave ITpart ITpart.hsh | hsave ITaction ITaction.hsh
hsave ITnick ITnick.hsh | hsave ITCtext ITCtext.hsh
hsave ITCquit ITCquit.hsh | hsave ITCjoin ITCjoin.hsh
hsave ITCnotice ITCnotice.hsh | hsave ITCpart ITCpart.hsh
hsave ITCaction ITCaction.hsh | hsave ITCnick ITCnick.hsh
}