mIRC Home    About    Download    Register    News    Help

Print Thread
#161801 11/10/06 01:05 PM
Joined: Oct 2006
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Oct 2006
Posts: 11
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 ?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/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.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
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


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Oct 2006
Posts: 11
W
Pikka bird
OP Offline
Pikka bird
W
Joined: Oct 2006
Posts: 11
Nice Works Great !

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

Just Got Home From Work smirk


Link Copied to Clipboard