First thing I noticed, is the fact that your $remtok is missing a parameter

Here's my recommendation for an alternative code, but please note that this has not been tested.
Code:
alias purgeip {
  var %a = 1, %b = $hget(iptracker,0).item
  while %a <= %b {
    var %ip.item = $hget(iptracker,%a).item, %ip.data = $hget(iptracker,%a), %c = $numtok(%ip.data,32)
    while %c {
      var %dns = $gettok(%ip.data,%c,32)
      if !$hfind(dns,%dns,0) {        %ip.data = $remtok(%ip.data,%dns,1,32)      }
      dec %c
    }
    if !%ip.data {
      .hdel iptracker %ip.item
    }
    else {
       .hadd -m iptracker %ip.item %ip.data
    }
    inc %a
  }
}

Last edited by RusselB; 23/06/08 11:59 PM.