mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
Hello there,
I wanted to suggest a command or option with which the user could connect/disconnect from all currently active (in the treebar/switch bar) networks at once without having to switch and click on the flash for every network.
If anybody knows of a script for this (or could tell me how to do one myself), I'd appreciate that as well. smile

Joined: Jul 2006
Posts: 4,155
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,155
/Scon -at1 quit


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
Originally Posted By: Wims
/Scon -at1 quit

Ah cool, thanks. smile
Figured out how to connect to all disconnected servers again then: /Scon -at2 server $server
€dit: which fails with ZNC multiserver, haha. With $network it tries to connect to the same network/server everywhere tho. Oh well. laugh

Last edited by SignZ; 18/06/14 04:35 PM.
Joined: Jul 2006
Posts: 4,155
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,155
It fails with anything not just ZNC because $server is evaluated while a specific connection is active, $server will always return the server which you executed /scon on here.
That's by design because /scon is a command where its parameters actually form a command, so those parameters ($server is what is interesting here) are evaluated once while executing /scon, and one more time executing /server. To workaround the problem, you must escape the identifier with the ! identifier prefix, that way, $!server will return the plain text "$server" once /scon executes, and then $server will be correctly evealuated to the server for the connection /scon found.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
Hmm, for me it only fails with ZNC (since it's the same server.adress for both networks (just a different password combination) - the other networks I'm connecting to don't have that problem.
It kinda sucks but it's not that important, haha. $!server doesn't change that anyhow.

€dit: There doesn't happen to be something like $server.description, does it?
€dit2: Ok, there is $server(N).desc but how could I use that with the /scon -at2 server thing?

Last edited by SignZ; 18/06/14 10:04 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
If you were connected already you can just use /server (with no arguments) and it will connect to the previous server with the password you had used.

Joined: Jul 2006
Posts: 4,155
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,155
Right, I missed the fact you were using /scon from the editbox with only one slash, which does not evaluate the line, so $server is evaluated once.

Even though /server will work here because mIRC has the data internally, I don't think there is a way to get the password used to connect to the server in /server, that might be an useful addition.

Last edited by Wims; 18/06/14 10:20 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
Just tried that, it connected both connections (one ZNC account with 2 networks added, the whole shenanigans) to the same network instead of 1 to 1 and 2 to 2 it connected 1 to 2 and 2 to 2. smirk

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
That's not the behavior I'm seeing, and to my knowledge using /server with no arguments should be the same as pressing the reconnect button in the toolbar. Does using the button also confuse your networks? Have you entered these addresses into mIRC's server list? That can cause issues.

As a workaround you can try storing and associating $network and $cid when you're connected so that when you need to reconnect you can check the $cid and decide which password to use.

Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
No problems like that when using the button and yup, I added them to my serverlist. So, do you think it would/should work when they aren't in the list?

As for the workaround, I'm in no way near being an expert so I don't quite get that, haha. frown

Joined: Aug 2012
Posts: 12
SignZ Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2012
Posts: 12
Well, I found a really simple solution. I just put the server's IP instead of the address in the ZNC's second entry.


Link Copied to Clipboard