mIRC Home    About    Download    Register    News    Help

Print Thread
#203909 01/09/08 03:31 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What I'm looking for is basically
Code:
alias close.win {
var %current = $network
scon -at1 $iif($network != %current,window -c "status window")
}


1) I'd like to get this working (currently I always get "* /scon: insufficient parameters")
2) If possible, and without having to write a completely different code, allow the code to be run using a timer.

Joined: May 2004
Posts: 24
K
Ameglian cow
Offline
Ameglian cow
K
Joined: May 2004
Posts: 24
Code:
alias close.win {
  var %current = $network
  scon -at1 $!iif($network != %current ,window -c "status window",noop)
}

This way it works
Just add ! near iif and a space after %current
I don't know why a space is needed though

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
1) $iif() is not the right tool for the job: if you want to execute commands on condition, just use /if. $iif() is for returning values on condition. Besides, your $iif() is evaluating the condition in the current context (the calling script) and not in each connection's context (meaning window -c "status window" is never returned, since $network is always equal to %current in the current context). The following should work:
Code:
alias close.win {
  var %current = $network
  scon -at1 if ($network != % $+ current) window -c "status window"
}


2) I'm not sure what you mean about the /timer. Wouldn't eg
/timer 1 5 close.win
do the job?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard