Advertisement
westor

!Top10 Command (INI) for Sherby v1.2

May 29th, 2020
1,679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.29 KB | None | 0 0
  1. ON *:TEXT:!top10:#: {
  2.   var %f = users.ini
  3.  
  4.   if (!$file(%f)) { msg $chan ( $+ $nick $+ ): The database is clear! | return }
  5.  
  6.   unset %top_nick
  7.  
  8.   if ($window(@temp_db)) { window -c $v1 }
  9.   if ($window(@temp_values)) { window -c $v1 }
  10.  
  11.   window -h @temp_db
  12.   window -h @temp_values
  13.  
  14.   loadbuf $lines(%f) @temp_db $qt(%f)
  15.  
  16.   var %t = $line(@temp_db,0)
  17.  
  18.   var %i = 1
  19.   while (%i <= %t) {
  20.     var %l = $line(@temp_db,%i)
  21.  
  22.     if (*money* iswm %l) && (%top_nick) { aline @temp_values %top_nick $remove(%l,money=) | unset %top_nick | goto next }
  23.  
  24.     if ($left(%l,1) == [) { set -e %top_nick $right($left(%l,-1),-1) }
  25.  
  26.     :next
  27.     inc %i
  28.   }
  29.  
  30.   unset %top_nick
  31.  
  32.   filter -cetuww 2 32 @temp_values @temp_values
  33.  
  34.   var %z 1
  35.   while (%z <= 10) {
  36.     var %line = $line(@temp_values,%z)
  37.     var %nick = $gettok(%line,1,32)
  38.     var %value = $gettok(%line,2,32)
  39.  
  40.     if (!%nick) { goto next2 }
  41.     if (!%value) { var %value = 0 }
  42.  
  43.     var %list = $addtok(%list,%nick $chr(36) $+ %value,44)
  44.  
  45.     :next2
  46.     inc %z
  47.  }
  48.  
  49.  
  50.   if (%list) { msg $chan ( $+ $nick $+ ): TOP10 Stats (money) are: $replace(%list,$chr(44),$+($chr(44),$chr(32))) }
  51.   else { msg $chan ( $+ $nick $+ ): The database has not any $qt(money) values added yet! }
  52.  
  53.   window -c @temp_db
  54.   window -c @temp_values
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement