Advertisement
westor

!TOP10 command via .db way v1.0

Feb 3rd, 2015
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.48 KB | None | 0 0
  1. ON !*:TEXT:*:#: {
  2.   tokenize 32 $strip($1-,burci)
  3.   if (!$isdir($mircdirmessages-data)) {  return }
  4.   var %db = $mircdirmessages-data\ $+ $mkfn($chan) $+ .db
  5.   var %le = $gettok($read(%db,ntw,$nick *),2,32)
  6.   var %le_n = $readn
  7.   var %len = $len($1-)
  8.   if (%len) {
  9.     if (%le_n) { write -l $+ %le_n $qt(%db) $nick $calc(%le + %len) }
  10.     elseif (!%le_n) { write $qt(%db) $nick %len }
  11.   }
  12.   if ($1 == !top) || ($1 == !top1) { chan_stats_top $chan $nick 1 }
  13.   if ($1 == !top2) { chan_stats_top $chan $nick 2 }
  14.   if ($1 == !top3) { chan_stats_top $chan $nick 3 }
  15.   if ($1 == !top5) { chan_stats_top $chan $nick 5 }
  16.   if ($1 == !top10) { chan_stats_top $chan $nick 10 }
  17.   if ($1 == !top15) { chan_stats_top $chan $nick 15 }
  18.   if ($1 == !top20) { chan_stats_top $chan $nick 20 }
  19. }
  20.  
  21. alias chan_stats_top {
  22.   if ($status !== connected) { return }
  23.   if (!$1-) { return }
  24.   if ($me !ison $1) { return }
  25.   var %ch = $1
  26.   var %nick_for = $2
  27.   var %tt = $3
  28.   var %win = @top_ $+ %ch
  29.   var %db = $mircdirmessages-data\ $+ $mkfn(%ch) $+ .db
  30.   var %db_lines = $lines(%db)
  31.   if (!$isfile(%db)) { return }
  32.   if ($window(%win)) { window -c %win }
  33.   window -hj $+ %db_lines %win
  34.   loadbuf %win $qt(%db)
  35.   filter -ceutww 2 32 %win %win
  36.   var %ii 1
  37.   while (%ii <= %tt) {
  38.     var %list = $addtok(%list,$line(%win,%ii),44)
  39.     inc %ii
  40.   }
  41.   .msg $1 ( $+ %nick_for $+ ): TOP $+ %tt Stats (messages) are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
  42.   if ($window(%win)) { window -c %win }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement