If you're not using any other identifiers, you'll have to find the one with the lowest time.

Code:
while $hfind(seen, time.*, 0, w) > 999 {

  ;Set %time to $ctime at start. Compare all entries to this %time variable.
  var %time $ctime

  ;Check all time. entries.
  var %count 0
  while %count < 1000 {
    var %count $calc(%count + 1)
    var %entry $hfind(seen, time.*, %count, w)

    ;If the value for this entry is lower than %time, this is the lowest entry found so far.
    if $hget(seen, %entry) < %time {
      var %time $hget(seen, %entry)
      var %nick $right(%entry, -5)
    }
  }

  ;Remove the oldest entry
  hdel seen action. $+ %nick
  hdel seen channel. $+ %nick
  hdel seen time. $+ %nick
  hdel seen network. $+ %nick
}


Put the code in your on join script or in it's own alias, and whenever there are more than 999 entries, it will keep deleting the highest entry until 999 are left.

PS. it might be smarter to base your database on time instead of simply the last 1000 entries.

EDIT: $+ between time. and * was kind of obsolete :P

Last edited by Thels; 28/08/10 05:31 PM.