mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2014
Posts: 19
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Apr 2014
Posts: 19
So whenever the bot disconnects, it stops adding points to everyone until they disconnect and reconnect.



Here's what I have setup:

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 for %topic
}

alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}

on *:text::#uminokaiju:{
if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
set -u10 %floodpoints On
set -u30 %floodpoints. $+ $nick On
msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) Ninja Stars!
}

on $*:text:/!stars (add|remove)/Si:#uminokaiju:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <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) Ninja Stars! }
}
else { msg $chan This command is only available to moderators. }
}
on !*:join:#uminokaiju:{
$+(.timerpoints.,#,.,$nick) -o 0 60 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
raw 366:*:{
var %i = 1
while ($timer(%i)) {
if ($+(points.,$2,.,*) iswm $v1) {
var %a = $v2
if ($gettok(%a,-1,46) !ison $2) { .timer $+ %a off | continue }
}
inc %i
}
}
on !*:part:#uminokaiju:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}





Last edited by RapidHaste; 04/05/14 03:57 AM.
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
The code you have does tell the bot to keep adding points even when the bot is disconnected.
When the bot is disconnected, you can type /timers to check whether timers are still there or not.
If not, you may want to check your other code since the code you provide here most likely is not the cause.


Link Copied to Clipboard