mIRC Homepage
Posted By: RusselB Closing status windows - 01/09/08 03:31 AM
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.
Posted By: kocam Re: Closing status windows - 01/09/08 09:19 AM
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
Posted By: qwerty Re: Closing status windows - 01/09/08 10:14 AM
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?
© mIRC Discussion Forums