mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2013
Posts: 9
L
Loke_AF Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2013
Posts: 9
Hello,

I use on *:START: in a remote script to connect to multiple networks.
Before I sleep my pc I use an alias with
Code:
/scon -at1 disconnect
to disconnect from any network.

What I am looking to do is when I wake up the pc to use an alias to force windows 1,3,5 etc to (re)connect without having to manually select each window (network) and click connect.

Even if it's possible to make a window, the "active" window and then issue reconnect would work I guess.

Cheers

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
The issue is having some kind of event triggered when you wake up the pc, which doesn't exist in mIRC currently


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2013
Posts: 9
L
Loke_AF Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2013
Posts: 9
Originally Posted By: Wims
The issue is having some kind of event triggered when you wake up the pc, which doesn't exist in mIRC currently


Yes that's why I specified I am looking to create an alias, I don't mind having to type an alias after the pc is woken up from sleep.
I just want to avoid doing one connect per window.

Last edited by Loke_AF; 06/11/15 06:43 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
/server can be used with no arguments to reconnect to that window's server

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Right, you said 'when i wake up the pc', "when" implies an event somehow, I can't guess you meant to manually execute the alias rather than automatically execute it..

If you used /scid -at1 to disconnect all connected status window, you can also use /scid to connect all disconnected status window, executing /server itself as Loki mentioned:

/scid -at2 server


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2013
Posts: 9
L
Loke_AF Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2013
Posts: 9
Originally Posted By: Wims
Right, you said 'when i wake up the pc', "when" implies an event somehow, I can't guess you meant to manually execute the alias rather than automatically execute it..

If you used /scid -at1 to disconnect all connected status window, you can also use /scid to connect all disconnected status window, executing /server itself as Loki mentioned:

/scid -at2 server


Well I guess you are right, what I wrote wasn't very clear on that part.

As for the above works perfectly fine.
The only downside is that if I have 6 windows it will affect all 6 and looking at help I didn't see any easy way to limit that to specific ones (I guess there could be a way to get the ids of windows and specifically start the ones I want), but that's not really that important.

Thank you both for your help!

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Quote:
The only downside is that if I have 6 windows it will affect all 6
No, it would affect the non connected status windows only, if that's not what you want, then you don't want -t2, but you must explain clearly what you want


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2013
Posts: 9
L
Loke_AF Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2013
Posts: 9
Originally Posted By: Wims
Quote:
The only downside is that if I have 6 windows it will affect all 6
No, it would affect the non connected status windows only, if that's not what you want, then you don't want -t2, but you must explain clearly what you want


Let's say I have 6 windows for the 6 networks I connect to.
I usually have 3 of them connected and connect to the other 3 every X days since I am behind a BNC and they are not so important.

If I use the /scid -at2 after waking the pc, it will reconnect to all 6 windows since all are disconnected (I have used the /scon -at1 command before sleeping the pc) and they match the N=2 flag.

Would it be possible to specifically trigger with the alias say windows 1,2,3 ?

Hope I made myself clear.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Call a custom alias instead of /server directly for all servers

In this alias check if ($network == XXX) { server }

If you know the $scon or $scid you can use those directly instead of checking $network

Joined: Oct 2013
Posts: 9
L
Loke_AF Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Oct 2013
Posts: 9
Originally Posted By: Loki12583
Call a custom alias instead of /server directly for all servers

In this alias check if ($network == XXX) { server }

If you know the $scon or $scid you can use those directly instead of checking $network


I was thinking of how exactly I would do that (no idea if an alias can have an if tree inside it) and too lazy to even try it atm since connecting to all is ~ok for the time being.

But thanks again to both of you!


Link Copied to Clipboard