on *:TEXT:!top10:#:{
top10 #
}
alias -l top10 {
window -h @. | var %i 1
while $gettok($remove($read(points.ini,w,$+(*,$1,*),%i),[,]),2,46) {
var %n $v1, %p $gettok($read(points.ini,$calc($readn + 1)),2,61)
aline @. %n %p
var %i $calc($readn + 1)
}
filter -cetuww 2 32 @. @.
var %i 1 | while %i <= 10 {
var %list $addtok(%list,$line(@.,%i),44)
inc %i
}
msg $1 Top 10 Problem solvers are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
window -c @.
}
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
}
alias doaddpoints {
if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
var %topic $+($1,.,$2)
var %points $calc($readini(Points.ini,%topic,Points) + $3)
writeini -n Points.ini %topic Points %points
echo -a Added points to %topic
}
alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}
on *:text:!bal:#:{
if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
set -u10 %floodpoints On
set -u30 %floodpoints. $+ $nick On
msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total solutions.
}
on $*:text:/!bal (add|remove)/Si:#:{
if ($nick == dailyproblem) {
if ($0 < 3) { msg # Insufficient parameters: Use !bal <add|remove> <user> [number] | return }
writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total solutions.
}
else { msg $chan This is my command bro! Only Daily can use it! }
}
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 60 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}