mIRC Home    About    Download    Register    News    Help

Print Thread
Multiple Servers Autojoin #207366 14/12/08 07:03 PM
Joined: Nov 2007
Posts: 8
D
Desche Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Nov 2007
Posts: 8
Because the perform option built into mIRC doesn't work when I want to join multiple servers at once, I have been trying to create a script for a bit that would let me join multiple channels on multiple servers on startup.


Php Code:
on *:START: {
  server <server> -i nick alt email name -j #channel, #channel
  server -m <server> -i nick alt email name -j #channel, #channel
}  


This is what I have so far, with a lot of help from people on this forum and off of it. I was wondering if it was possible to identify a nick as well. A problem I've also run into is that when I implement the script, it only joins the first channel -- is there a way around that?

I have tried to find a list of available commands, but haven't had any luck. Sorry :P.

Re: Multiple Servers Autojoin [Re: Desche] #207368 14/12/08 07:13 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
From the looks of it the /server command does not support multi-channel joins. I would recommend using on CONNECT events for this.

Code:
on *:CONNECT:{
  if ($network == xxxx) { join #chan1,#chan2,... }
  elseif ($network == yyy) { join #chan3,#chan4,... }
}

You *could* add the identify command there as well, but personally I think it's better to let that respond to the notice NickServ generally sends you. For example...

Code:
on *:NOTICE:*This nickname is registered and protected*:*:{
  if ($nick == NickServ) && ($network === xxxx) { .msg NickServ identify pass }
  if ($nick == NickServ) && ($network === yyyy) { .msg NickServ identify pass }
}

If you have the same password on all networks (PLEASE DON'T :P) you don't need separate lines and the "$nick == NickServ" suffices.

If there are other ways you have to identify you'll have to resort to something similar/else. ;-)

Re: Multiple Servers Autojoin [Re: Desche] #207369 14/12/08 07:28 PM
Joined: Nov 2007
Posts: 8
D
Desche Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Nov 2007
Posts: 8
If I did use the on notice, would it only run after the other script completed itself? I join multiple channels that require a registered nickname, and not being able to join all of them would defeat the purpose lol

Re: Multiple Servers Autojoin [Re: Desche] #207370 14/12/08 07:34 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
No, you would have a problem there. The setup I use is.

1. Connect to the server (with an on START event)

2. Identify with services (with an on NOTICE event)

3. Join channels (with another on NOTICE event, responding to the messages saying you have successfully identified)

For that last one I personally use...

Code:
on $*:NOTICE:/Password accepted --? you are now recognized\./:*:{
  if ($nick == NickServ) && ($network === xxx) { join #chan,#chan }
  if ($nick == NickServ) && ($network === yyy) { join #chan,#chan }
}

Re: Multiple Servers Autojoin [Re: Desche] #207372 14/12/08 07:47 PM
Joined: Nov 2007
Posts: 8
D
Desche Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Nov 2007
Posts: 8
So, just for clarification... the final code would look like this?

Php Code:

on *:START: {
  server <server1> -i nick alt email name
  server -m <server2> -i nick alt email name
}  

on *:NOTICE:*This nickname is registered and protected*:*:{
  if ($nick == NickServ) && ($network === <server1>) { .msg NickServ identify pass }
  if ($nick == NickServ) && ($network === <server2>) { .msg NickServ identify pass }
}

on $*:NOTICE:/Password accepted --? you are now recognized\./:*:{
  if ($nick == NickServ) && ($network === <server1>) { join #chan,#chan }
  if ($nick == NickServ) && ($network === <server2>) { join #chan,#chan }
} 


Last edited by Desche; 14/12/08 07:47 PM.
Re: Multiple Servers Autojoin [Re: Desche] #207373 14/12/08 07:52 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Looks like it, yes, assuming they both have NickServ and send those notices to you.
Make sure you have the correct match for $network
Just go to the server window of the network when connected and do: //echo -a $network

Re: Multiple Servers Autojoin [Re: Desche] #207375 14/12/08 07:58 PM
Joined: Nov 2007
Posts: 8
D
Desche Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Nov 2007
Posts: 8
Awesome. Thanks man!

Re: Multiple Servers Autojoin [Re: Desche] #207376 14/12/08 08:01 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline
Fjord artisan
Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
thanks this post was helpful