You're incurring such latency because of the structure of your file. Instead of giving each user their own topic make all the entries items of a single [Points] topic, or at least a topic per channel. You can gain even more speed moving everything into hash tables.

You can use this alias to import your existing file:
Code:
alias points.import {
  if (!$exists(Points.ini)) return

  rename Points.ini Points.old.ini
  filter -k Points.old.ini points.filter *
  unset %prev
}

alias points.filter {
  var %line = $1-
  if (%line == $null) return

  if ($regex(%line,^Points=(\d+))) {
    var %points = $regml(1)

    if ($regex(%prev,/^\[(#.+?)\.(.+?)\]/)) {
      var %chan = $regml(1)
      var %nick = $regml(2)

      add.pts %chan %nick %points
    }
  }

  %prev = %line
}



This is the improved set of code implemented with hash tables. I've removed the line where you immediately gave people points for joining, I know in the past people have exploited this to gain points. There's a 5 second debounce on saving after points have been added, this can be changed to suit your needs or can be removed entirely to rely on the file being saved on exit.
Code:
on *:text:!gold:#:{
  PRIVMSG $nick Tu turi $get.pts(#,$nick) tasku.
}

on !*:join:#:$+(.timerpoints.,#,.,$nick) 0 1800 add.pts # $nick

on !*:part:#:$+(.timerpoints.,#,.,$nick) off

on *:exit:save.pts

alias -l add.pts {
  var %chan = $$1, %nick = $$2, %points = $3, %table = points. $+ %chan, %file = Points.ini

  noop $load.pts(%table,%file,%chan)

  hinc %table %nick %points

  .timeradd.pts. $+ %chan 1 5 hsave -i %table %file %chan
}

alias -l get.pts {
  var %chan = $$1, %nick = $$2, %table = points. $+ %chan, %file = Points.ini

  noop $load.pts(%table,%file,%chan)

  return $hget(%table,%nick)
}

alias -l load.pts {
  var %table = $1, %file = $2, %topic = $3

  if (!$hget(%table)) {
    hmake %table
    hadd -m points.meta %table %topic
    hsave -i points.meta %file meta

    if ($ini(%file,%topic)) hload -i %table %file %topic
  }
}

alias -l save.pts {
  var %file = Points.ini, %i = 1

  while ($hget(points.meta,%i).item) {
    var %table = $v1, %topic = $hget(points.meta,%table)

    hsave -i %table %file %topic

    inc %i
  }
}

Last edited by Loki12583; 28/12/15 08:42 PM.