I'm trying to write an alias that outputs op bans from most to least.

It should outpt something like:

Chan ban stats: Nick1: x bans (x%) Nick2: x bans (x%) Nick3: x bans (x%)

It will list in order from the op that banned the most bans to the op with the least least.

$ibl($1,N).by is the op of the Nick!host, so $gettok($ibl($1,N).by,1,33) will just be the Nick.

Here's what I got so far:

Code:
/banstats {
  var %b = 1
  while (%b <= $ibl($1,0).by) {
    var %nick = $gettok($ibl($1,%b).by,1,33)
    if ($gettok($ibl($1,%b).by,1,33) == %nick) inc -u5 %nickbans $+ %nick 1
    /echo -s %nick $eval(% $+ nickbans $+ %nick,2)
    inc %b
  }
}


And it while loops the ban list:

Op1 1
Op2 1
Op3 1
Op1 2
Op1 3
Op1 4
Op4 1
Op5 1
Op2 2
Op2 3
Op1 5

Each time the same op nick is reached, the counter goes up.

That means at the end of the ban list, the last number of the nick of the op is the most bans total set by that individual op.

Well I need help with returning the last variable counter, and.. outputting them in order from most to least (I can deal with finding the %'s of course).

Thanks.

-Neal.