mIRC Home    About    Download    Register    News    Help

Print Thread
Connecting to multiple servers on startup #259568 28/12/16 06:53 AM
Joined: Dec 2016
Posts: 6
J
Jeffen Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Dec 2016
Posts: 6
I want to connect to 3 servers when i start mIRC, right now it's just connecting to one of them.

i have several channels on the servers i want to connect to at start up as well

any idea of how i can do this?

Re: Connecting to multiple servers on startup [Re: Jeffen] #259569 28/12/16 07:28 AM
Joined: Feb 2011
Posts: 311
K
KindOne Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Feb 2011
Posts: 311
Tools -> Script Editor -> Remote tab:

on *:start:{
server irc.freenode.net -j #cake,#foobar,##mirc
server -m irc.efnet.org
server -m irc.quakenet.org -j #chan1,#chan2
}


Edit it to whatever you want.


irc.swiftirc.net #msl (mIRC Scripting Language)
Re: Connecting to multiple servers on startup [Re: Jeffen] #259570 28/12/16 08:32 AM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
I use a ON START event, similar to what is posted above. Difference is that I have it start a timer to run an alias. Also have function key aliases, so that I can skip the timer (start sooner) or cancel it (not connect at all). That way it's automated, but I have the option to make changes before connecting.

Something like this:
Code:
ON *:START:{
  var %t = 30
  echo -tag Starting in %t seconds, press SHIFT-F5 to ABORT or SHIFT-F8 to START now
  .timerStart 1 %t startup::run
}

alias sF5 {
  if ( $timer(Start) ) {
    .timerStart off
    echo -tag Timer Halted.
  }
}
alias sF8 {
  if ( $timer(Start) ) {
    .timerStart off
    echo -tag Starting now.
    .timer 1 0 startup::run
  }
}

alias startup::run {
  startup::connect (same params as /server command)
  startup::connect -m (same params as /server command)
}
alias startup::connect {
  echo -ts /!server $1-
  !server $1-
}


The benefit of the last bit is it shows you exactly what is being executed for the server command, so if something starts going wrong, you can go back and troubleshoot it.

Where you see 'startup::connect' inside the alias, treat that exactly like the /server command, using the same parameters. Don't include the '/server' command, only everything after it. As mentioned in the above post, use -m for all connections after the first. Or you could use it for all connections, and have the initial status window as a sort of 'root' window. Whatever floats your boat.

Re: Connecting to multiple servers on startup [Re: KindOne] #259572 28/12/16 08:55 AM
Joined: Dec 2016
Posts: 6
J
Jeffen Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Dec 2016
Posts: 6
on connect > options > perform... i have /msg Nickserv IDENTIFY password to perform on connect to all networks.

it seems that the script you gave me executes before the identifying command so that some channels wont connect since you need to be registered to do so.
any ides to fix that?

Re: Connecting to multiple servers on startup [Re: KindOne] #259589 31/12/16 05:11 AM
Joined: Dec 2016
Posts: 6
J
Jeffen Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Dec 2016
Posts: 6
That works but my nick doesnt run its registering until after i've connected to all the channels, so some channels that need a registered nick to access kicks me out

any idea how i run the nick register right after i've connected to the servers?