alias -l addPoints {
if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
var %topic $+($chan,.,$nick)
var %points $calc($readini(Points.ini,%topic,Points) + $1)
writeini -n Points.ini %topic Points %points
return %points
}
alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Points.ini,%topic,Points)
return %points
}
Just create the appropriate triggers to access these commands. Note that I flagged them as local commands, this prevents another script from causing problems because of a command with a similar name. But, this also means you can't use the command except inside the script it was created for. Also, using either of these returns a value equal to the number of points added.
on 1:text:*:#:{
var %points $addPoints(5)
msg $chan Bot awards 5 points to $nick $+ , total points %points $+ .
}
This is just an example, I don't recommend doing your trigger exactly like that. But each time a person speaks, it will add 5 points to their total, and the command will actually look up the point total for the player, tack on the points, then return the total number. After that, the trigger just tells how many points were given to that player.
on 1:text:!points:#:{
var %points $lookUpPoints
msg $chan $nick has %points total points.
}
And this allows a person to type !points, and get their points total.