Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON !*:TEXT:*:#: {
- tokenize 32 $strip($1-,burci)
- if (!$isdir($mircdirmessages-data)) { return }
- var %db = $mircdirmessages-data\ $+ $mkfn($chan) $+ .db
- var %le = $gettok($read(%db,ntw,$nick *),2,32)
- var %le_n = $readn
- var %len = $len($1-)
- if (%len) {
- if (%le_n) { write -l $+ %le_n $qt(%db) $nick $calc(%le + %len) }
- elseif (!%le_n) { write $qt(%db) $nick %len }
- }
- if ($1 == !top) || ($1 == !top1) { chan_stats_top $chan $nick 1 }
- if ($1 == !top2) { chan_stats_top $chan $nick 2 }
- if ($1 == !top3) { chan_stats_top $chan $nick 3 }
- if ($1 == !top5) { chan_stats_top $chan $nick 5 }
- if ($1 == !top10) { chan_stats_top $chan $nick 10 }
- if ($1 == !top15) { chan_stats_top $chan $nick 15 }
- if ($1 == !top20) { chan_stats_top $chan $nick 20 }
- }
- alias chan_stats_top {
- if ($status !== connected) { return }
- if (!$1-) { return }
- if ($me !ison $1) { return }
- var %ch = $1
- var %nick_for = $2
- var %tt = $3
- var %win = @top_ $+ %ch
- var %db = $mircdirmessages-data\ $+ $mkfn(%ch) $+ .db
- var %db_lines = $lines(%db)
- if (!$isfile(%db)) { return }
- if ($window(%win)) { window -c %win }
- window -hj $+ %db_lines %win
- loadbuf %win $qt(%db)
- filter -ceutww 2 32 %win %win
- var %ii 1
- while (%ii <= %tt) {
- var %list = $addtok(%list,$line(%win,%ii),44)
- inc %ii
- }
- .msg $1 ( $+ %nick_for $+ ): TOP $+ %tt Stats (messages) are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
- if ($window(%win)) { window -c %win }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement