Quick suggestion (untested)
I don't know what the -o switch should be for, though.
Code:
on *:start: {
  hashfiles load
  .enable #ontond_text
  .enable #ontond_action
  set -e %ontond_server off
  set -e %ontond_targets off
}

on *:exit: { hashfiles save }

alias hashfiles {
  var %dir = $mircdirData\
  var %tables = ont ond ontond_targets ontond_servers
  var %n = 1

  if ($1 == load) {
    while ($gettok(%tables,%n,32)) {
      var %table = $v1
      hmake %table
      if ($isfile($+(%dir,%table,.hsh))) { hload -b %table $qt($+(%dir,%table,.hsh)) }
      inc %n
    }
  }

  elseif ($1 == save) {
    while ($gettok(%tables,%n,32)) {
      var %table = $v1
      if ($hget(%table,1)) { hsave -b %table $qt($+(%dir,%table,.hsh)) }
      inc %n
    }
  }
}


As it's using an alias, you can e.g. trigger the "/hashfiles save" command every now and then (to reduce data loss by crashes or the like).
Saving/loading tables in binary format (-b switch) may speed up the load and save procedure; compared to -i (ini format) at least it's noticeable smile

Last edited by Horstl; 03/11/08 09:54 PM.