mIRC Home    About    Download    Register    News    Help

Print Thread
#76673 25/03/04 07:04 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
I have the following alias:

alias netret {
if ($1 != $null) return $1
elseif ($2 != $null) return $2
else return Unknown-Network
}

This alias gets the network name as $1 and the server as $2

I have a configuration window which I can set a delay so after than period it will put me in Away mode.

I'm connected to several networks, so what I did it saving the delay inside a INI, and when I start the timer, it reads the delay and set a timer to each network. I'm trying to use scon

The problem is that I use the following command:
scon -at1 .timerAway. $+ retnet($network,$server) 1 $readini(" $+ $scriptdir\config.ini",config,away) imaway

The problem is that the away timer is only set on the network that I started the command on (Using a dialog).

So if I'm connected to DalNet, then I will only get timerAway.DalNet

I know that I can use "!" to make it evalute the indentifiers on the right connection ID, but it doesn't work.

I tried using $!retnet($network,$server), and even $retnet($!network,$!server), but if I put the "!", then the timer name is like away.$network, or like away.$retnet($network,$server).

I use the retnet, cause some networks doesn't sends it Network name, so I get NULL (so ther is a chance that few networks will have the same timers).


How do I solve this??

Thanks

#76674 25/03/04 07:06 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
BTW, I wanted to write "I realy don't get it" as the title....

#76675 25/03/04 07:10 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
well $2 will never be called, considering if $2 isn't $null then neither is $1


New username: hixxy
#76676 25/03/04 07:26 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Lets say I'm conencted to a server and it doesn't sends the network name, then $1 will be NULL and $2 will be the server.

It is not that the server becomes $1 because I used $function(parameter1,parameter2,...), and it doesn't matter if one of the parameters is NULL.

#76677 25/03/04 07:53 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Shortened the alias a bit:
Code:
alias netret return $iif($1 != $null,$1,$iif($2 != $null,$2,Unknown-Network))


Highlighted the necessary !'s:
scon -at1 timerAway. $[color:red]!+ $!netret($network,$server) 1 $readini(" $+ $scriptdir\config.ini",config,away) imaway[/color]


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#76678 25/03/04 08:13 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Thanks for helping me with the "!", I'll try it

#76679 25/03/04 08:22 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Thanks, it works.


Link Copied to Clipboard