mIRC Homepage
Posted By: WarlockTheWeary Help With Stats Script Plz - 11/10/06 01:05 PM
trying to do a stats script ...

i need it to check an unowins.ini file that looks like this ...
[jackie_5012]
wins=8
[gwyidr]
wins=1
[WarlockWeary]
wins=8
[|Raven|]
wins=10

I want it to check the "wins" and display in order the top 10
best "wins"

HELP!

alias xxx {
var %next = 0
/msg $chan 4[ 7UNO Stats ... 4]
var %x = 1, %total = $lines(unowins.ini)
while (%x <= %total) {
var %next = $calc( %next + 1 )
var %1 = $read(unowins.ini,%x)
var %2 = $remove(%1,[,])
var %3 = $readini(unowins.ini,%2,wins)
var %4 = $remove(%3,w)
if (( %next == 1 ) || ( %next == 3 ) || ( %next == 5 ) || ( %next == 7 ) || ( %next == 9 ) || ( %next == 11 )) { /msg $chan 04[ 11Name: %1 Wins: %4 !4 ] }
inc %x
}
}

Dont work right ... help plz ?
Posted By: Riamus2 Re: Help With Stats Script Plz - 11/10/06 01:34 PM
/help /filter

I'd give more help, but I'm about to leave for work, so don't have time. Someone else may expand on this, or you can try it out. Just filter it so you get only the win lines and have it sorted by the number of wins and in numerical order. Then you can output the top10 easily.
Posted By: xDaeMoN Re: Help With Stats Script Plz - 11/10/06 03:39 PM
Try this

Code:
 alias top10 {
  var %d = 1, %w = @top10, %file = FILE.ini
  window -hn %w
  clear %w
  while $ini(%file,%d) {
    aline %w $v1 $readini(%file,$v1,wins)
    inc %d
  }
  filter -cteuww 2 32 %w %w
  var %k = 1, %c
  while %k &lt;= 10  {
    %c = %c $+($chr(32),12,$chr(35),%k,) $iif($line(%w,%k),$v1,*)
    inc %k
  }
  window -c %w
  return %c
} 
 


Syntax: $top10

//echo -a $top10

** Change FILE.ini
Posted By: WarlockTheWeary Re: Help With Stats Script Plz - 11/10/06 09:23 PM
Nice Works Great !

Thanks You Very Much For The help ..
Sorry For the late responce ..

Just Got Home From Work smirk
© mIRC Discussion Forums