Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 1.10 KB | Hits: 65 | Expires: Never
Copy text to clipboard
  1. alias rank {
  2.   close -@ @list*
  3.   ;;$gwdRank(Name) returns "name :: score :: rank";;
  4.   window @list1
  5.   window @list2
  6.   var %a 1
  7.   while ($var(%cash*,%a)) {
  8.     aline -a @list1 %cash [ $+ [ $remove($var(%cash*,%a),$+($chr(37),cash)) ] ] $remove($var(%cash*,%a),$+($chr(37),cash))
  9.     inc %a
  10.   }
  11.   filter -wwteuc 1 1 @list1 @list2
  12.   var %b $fline(@list2,* $1)
  13.   return $+(4,$token($line(@list2,%b),2,32)) 14has4 $+($bytes($line(@list2,%b),b),GP) 14and is ranked4 $ord(%b) $+ .
  14. }
  15.  
  16. on $*:TEXT:/^[!@.]score/Si:*: {
  17.   if (!$2) {
  18.     if (%cash [ $+ [ $nick ] ] isnum) {
  19.       $iif($left($1,1) == @, msg $chan, .notice $nick) $rank($nick)
  20.       halt
  21.     }
  22.     if (%cash [ $+ [ $nick ] ] !isnum) {
  23.       $iif($left($1,1) == @, msg $chan, .notice $nick) 14Sorry4 $nick $+ 14, you have no score.
  24.       halt
  25.     }
  26.   }
  27.   if ($2) {
  28.     if (%cash [ $+ [ $2 ] ] isnum) {
  29.       $iif($left($1,1) == @, msg $chan, .notice $nick) $rank($2)
  30.       halt
  31.     }
  32.     if (%cash [ $+ [ $2 ] ] !isnum) {
  33.       $iif($left($1,1) == @, msg $chan, .notice $nick) 14Sorry4 $2 $+ 14, has no score.
  34.       halt
  35.     }
  36.   }
  37. }