Since I feel like being generous, here's a simple one for you.

Code:
on *:start: {
  hmake TopScores 100
  if ($isfile($scriptdir\topscores.hsh)) { hload TopScores $qt($scriptdir\topscores.hsh) }
}

on *:text:!addpoint & &:#: {
  if ($nick isop $chan && $3 isnum) {
    hadd TopScores $2 $calc($hget(TopScores,$2) + $3)
    .notice $nick Added $3 points to $2 $+ .
  }
  hsave TopScores $qt($scriptdir\topscores.hsh)
}

on *:text:!delpoint & &:#: {
  if ($nick isop $chan) {
    if ($3 isnum) {
      hadd TopScores $2 $iif($calc($hget(TopScores,$2) - $3) >= 0,$v1,0)
      .notice $nick Subtracted $3 points from $2 $+ .
    }
    elseif ($3 == all) {
      hadd TopScores $2 0
      .notice $nick Removed ALL points from $2 $+ .
    }
    hsave TopScores $qt($scriptdir\topscores.hsh)
  }
}

on *:text:!top5:#: {
  if (%Top5.fld) { return }
  set -u10 %Top5.fld On
  filter -ffcuten 2 32 hash.tmp
  var %cnt = 1
  while (%cnt <= 5) {
    var %data = $read(hash.tmp,%cnt)
    msg $chan $hget(TopScores,$gettok(%data,1,32)).item is 1/ $+ $hget(TopScores,0).item with $gettok(%data,2,32) points
    inc %cnt
  }
  .remove hash.tmp
}


This allows all ops or higher to use the add/del commands. If you want only admins to use it, you'll need to put them into your userlist and then make the script work from the userlist instead.

Keep in mind that 5 lines displayed all at once *could* get you flooded off the server. It's set up to not allow more than 1 Top5 display every 10 seconds (-u10), but just displaying the 5 may be too much on certain networks. Just try and you'll know.

I didn't bother adding error messages. It checks to prevent errors, but it won't tell the user that there was an error. If you want that and can't add it yourself, just say so and I or someone else will do it.


Invision Support
#Invision on irc.irchighway.net