het, i have been working on a game for a little while now, and all is going good, however, once the games gets to checking the numbers and counting the scores, i get a freeze, could be 1/2 a sec, to 3-4-5 seconds, depending on how many players joined in that round, so basically what i am looking for, is help in making the following code faster/better, to try to reduce the lenght of the freeze, or hopefully, stop the freeze all together.....in the following code, i have some custome i dentifer, and commands, so i will post those under the code, so you may better understand what its doing...:


Code:
 

alias comparenum {
  cplay -r won
  var %a = $ini(inplay.ini,generate,0), %b = $cplay(numbers,norm1), %c = $cplay(numbers,norm2), %d = $cplay(numbers,jackpot), %e = $cplay(numbers,bonus)
  while (%a > 0) {
    comparenum2 %a %b %c %d %e
    dec %a
  }
  echo 3 -ae *** Numbers Generated, Points Calculated, And Scores Completed, Notifying User Of New Scores...
  balance
}
alias -l comparenum2 {
  var %a = $1, %b = $2, %c = $3, %d = $4, %e = $5
  var %f = $cplay(betnum,$ini(inplay.ini,generate,%a)), %g = $cplay(wadge,$ini(inplay.ini,generate,%a))
  if ($istok(%f,%b,45)) {
    cplay won $ini(inplay.ini,generate,%a) $iif($cplay(won,$ini(inplay.ini,generate,%a)),$calc($ifmatch + (%g + (%g * $cset(main,normal)))),$calc(%g + (%g * $cset(main,normal))))
    cplay norm1 win $cplay(norm1,win) $ini(inplay.ini,generate,%a)    
  }
  else {
    cplay norm1 loss $cplay(norm1,loss) $ini(inplay.ini,generate,%a)
  }
  if ($istok(%f,%c,45)) {
    cplay won $ini(inplay.ini,generate,%a) $iif($cplay(won,$ini(inplay.ini,generate,%a)),$calc($ifmatch + (%g + (%g * $cset(main,normal)))),$calc(%g + (%g * $cset(main,normal))))
    cplay norm2 win $cplay(norm2,win) $ini(inplay.ini,generate,%a)
  }
  else {
    cplay norm2 loss $cplay(norm2,loss) $ini(inplay.ini,generate,%a)
  }
  if ($istok(%f,%d,45)) {
    cplay won $ini(inplay.ini,generate,%a) $iif($cplay(won,$ini(inplay.ini,generate,%a)),$calc($ifmatch + (%g + (%g * $cset(main,jackpot)))),$calc(%g + (%g * $cset(main,jackpot))))
    cplay jackpot win $cplay(jackpot,win) $ini(inplay.ini,generate,%a)
  }
  else {
    cplay jackpot loss $cplay(jackpot,loss) $ini(inplay.ini,generate,%a)
  }
  if ($istok(%f,%e,45)) {
    cplay won $ini(inplay.ini,generate,%a) $iif($cplay(won,$ini(inplay.ini,generate,%a)),$calc($ifmatch + (%g + (%g * $cset(main,bonus)))),$calc(%g + (%g * $cset(main,bonus))))
    cplay bonus win $cplay(bonus,win) $ini(inplay.ini,generate,%a)   
  }
  else {
    cplay bonus loss $cplay(bonus,loss) $ini(inplay.ini,generate,%a)
  }
  cplay lose $ini(inplay.ini,generate,%a) $calc($numtok($remove(%f,$cplay(numbers,norm1),$cplay(numbers,norm2),$cplay(numbers,jackpot),$cplay(numbers,bonus)),45) * %g)
}

 



thats the code right there, the other alias "balance" just sends a message to every user with their new balance.... here is the alias for "cplay"

Code:
 alias cplay {
  if ($isid) {
    var %a = $readini(inplay.ini,n,$1,$2)
    return %a
  }
  else {
    if ($1 == -r) {
      if (!$3) {
        remini inplay.ini $2
      }
      else {
        remini inplay.ini $2 $3
      }
    }
    else {
      writeini -n inplay.ini $1-
    }
  }
} 


so you see, if i have 30, 40+ players that round, it will take a long time to process all the info, and thus mirc freezes up untill its done.....
Thanks alot for any help in advance