Hi, i'm new to all this scripting, and starting to learn a bit.

I have made this script for a Twitch channel, and its works okay. The way it works is when the bot is online and people joins the chan. It gives you points every 10 minutes.
BUT if bot disconnects, it dont gives points again before the user disconnect and connect again.
Can some help me with fixing this ?

the script is here:

Code:
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:!bulls:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u5 %floodpoints On
  set -u30 %floodpoints. $+ $nick On
  msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) bulls.
}

on $*:text:/!bulls (add|remove)/Si:#:{
  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) bulls. }
  }
  else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
  $+(.timerpoints.,#,.,$nick) 0 600 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)


If some one wants to help me bit more.
If people use the command "!ticket 20" it should take 20 points from the points.ini file, and put it in a raffle. and when i (moderator) say "!ticket roll" it will pick a random user and post the winner.

And ofcause, it will make a message if the user dont have 20 points, and then the person will not be entering the raffle

Thank you in advanced

Last edited by Bullerbums; 12/08/13 08:50 PM.