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
}
}