Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:!top10:#: {
- var %f = users.ini
- if (!$file(%f)) { msg $chan ( $+ $nick $+ ): The database is clear! | return }
- unset %top_nick
- if ($window(@temp_db)) { window -c $v1 }
- if ($window(@temp_values)) { window -c $v1 }
- window -h @temp_db
- window -h @temp_values
- loadbuf $lines(%f) @temp_db $qt(%f)
- var %t = $line(@temp_db,0)
- var %i = 1
- while (%i <= %t) {
- var %l = $line(@temp_db,%i)
- if (*money* iswm %l) && (%top_nick) { aline @temp_values %top_nick $remove(%l,money=) | unset %top_nick | goto next }
- if ($left(%l,1) == [) { set -e %top_nick $right($left(%l,-1),-1) }
- :next
- inc %i
- }
- unset %top_nick
- filter -cetuww 2 32 @temp_values @temp_values
- var %z 1
- while (%z <= 10) {
- var %line = $line(@temp_values,%z)
- var %nick = $gettok(%line,1,32)
- var %value = $gettok(%line,2,32)
- if (!%nick) { goto next2 }
- if (!%value) { var %value = 0 }
- var %list = $addtok(%list,%nick $chr(36) $+ %value,44)
- :next2
- inc %z
- }
- if (%list) { msg $chan ( $+ $nick $+ ): TOP10 Stats (money) are: $replace(%list,$chr(44),$+($chr(44),$chr(32))) }
- else { msg $chan ( $+ $nick $+ ): The database has not any $qt(money) values added yet! }
- window -c @temp_db
- window -c @temp_values
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement