I am trying to integrate a script to check my away, and set myself as away if my idletime is above a certain time.

This is the code I have :

Code:
alias check_idle {
  /set %cur_con 1
  while (%cur_con <= $scid(0)) {
    if ($scon(%cur_con).idle >= $readini($scriptdir\away.ini,n,$network,idle_check)) {
      if ($scon(%cur_con).away == $false) {
        /awayscript $readini($scriptdir\away.ini,n,$network,idle_res)
      }
    }
    /inc %cur_con
  }
}
 


$readini($scriptdir\away.ini,n,$network,idle_check) is how long i am to be idle before i am set as away (time given in seconds)

$readini($scriptdir\away.ini,n,$network,idle_res) is the reason for being away (Idle)

/awayscript is the away script ( /awayscript <reason for away>

problem is, the script only checks the connection it is ran on, it always sets me as away regardless of how long my idletime is.

I've checked the help file regarding while loops, and every looks alright to me.