mIRC Home    About    Download    Register    News    Help

Print Thread
#102546 10/11/04 03:28 AM
Joined: Sep 2003
Posts: 19
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2003
Posts: 19
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.

Joined: Sep 2003
Posts: 19
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2003
Posts: 19
ignore this, moments after posting someone online looked at my code and pointed out the error laugh


w00f!

Link Copied to Clipboard