mIRC Homepage
Posted By: gomp On connect - 03/03/08 02:41 PM
Quote:
if ($network == AccessIRC) {
server -m irc.homelien.no
join #br1
join #ddayhome
dal
}


I got it like that.

When ever I connect to AccessIRC, it automatically conneccts to the other servers as well..

Problem is, when I disconnect only from AccessIRC but stay connected in the other servers. And then want to reconnect, then all the servers pop up, even though I am already connected.

So, I am asking for someone who knows how to use a "if not connected" command, so that if I already am on 'irc.homelien.no', it will not connect again, ignoring the bold command there.

I been searching myself silly, so the answer is probably right there infront of my eyes, so I ask for your help. smile
Posted By: 5618 Re: On connect - 03/03/08 03:58 PM
If the homealien connection is always your second server connection, you could use something like
Code:
if ($scid(2).network != EFNet) { }

or
Code:
if $scid(2).server != irc.homelien.no) { }

However, the first one does not give you info on whether you're connected or not. The second one using server does not return a value if you're disconnected. So depending on whether you want to check if the server window for the EFNet server exists or if you're connected, use the first or the second one.

Disregarding all this, you could also simply make the server connecting an on START event or just use an alias to connect to the next server (but that's probably not what you want).
Posted By: gomp Re: On connect - 03/03/08 08:12 PM
Hum.. I do not understand.

I'll explain exactly how I use this scripting.

I type /con in a blank mIRC status. Which connect me to accessIRC.. (..and join the channels I got preset.)

Then this code takes action..

Code:
 if ($network == AccessIRC) {
server -m irc.homelien.no   <---here it connect to EfNet..
join #br1
join #ddayhome
dal <---here it connect to DalNEt.. (via the alias below..)
}


This is the alias I got in aliases:
/dal /server -m irc.dal.net

So, by typing /con .. I automatically enter everything. smile

3 servers, and a lot of channels. (Need not include the whole code, it is a mess..)

Anyways.. All I want is for the "if ($network == AccessIRC) {" script, to not trigger, if I am already connected to the other servers..

I am starting to think this is impossible though. But then again, it might just be a simple word I spell wrong, or use wrong, as usual.. laugh

Perhaps you can help me? wink
Posted By: gomp Re: On connect - 03/03/08 08:19 PM
Code:
  if $scid(2).server != irc.homelien.no,irc.dal.net) { 
    if ($network ==  AccessIRC) {
      server -m irc.homelien.no
      join #br1 
      join #ddayhome
      timer 1 10 /windowhide
      timer 1 2 /joinacc
      dal 
    }
  }



I tested that, but that did not alter anything.
Posted By: Riamus2 Re: On connect - 03/03/08 11:45 PM
Why not just save yourself the trouble and put all servers you want into the on START event?
Posted By: gomp Re: On connect - 04/03/08 12:30 AM
Interesting.. In fear of sounding petty, I do not know how..

Hum.. Mayby using the /con for all servers?

I think I get it..

I'll test it once I am sober. smile Thanks as always! wink
Posted By: gomp Re: On connect - 04/03/08 12:31 AM
I do not get it..
Posted By: RoCk Re: On connect - 04/03/08 02:59 AM

He means something like this...

Code:

on *:START: {
  server irc.accessirc.net -jn #br1,#ddayhome
  server -m irc.homelien.no -jn #chan1,#chan2,#chan3
  server -m irc.dal.net -jn #chan1,#chan2,#chan3
}



Replace #chan1 #chan2 #chan3 with whatever you want, or remove them altogether.

/help /server
Posted By: Miguel_A Re: On connect - 04/03/08 09:56 PM
Humm i am not sure about your question.

But for what i could figured out you are traying to reconnect to a server when you have been disconnected and joines the proper channel etc etc etc.

Why you don´t use the options that mirc have already.

Alt + o --> Connect --> Options --> "Reconnect on disconnection"
Note:. Don´t forget to enable the connect retry out too

Them to join the channel you can use the "Channel list" icon the icon that you have on mirc.

With that you can choose to coonnect automatcaly when join a network ( choosed by you ).

Hope this can help.
If this was not what you ask for it, sorry...

good luck
Posted By: gomp Re: On connect - 09/03/08 02:37 PM
Originally Posted By: Miguel_A
Humm i am not sure about your question.

But for what i could figured out you are traying to reconnect to a server when you have been disconnected and joines the proper channel etc etc etc.

Why you don´t use the options that mirc have already.

Alt + o --> Connect --> Options --> "Reconnect on disconnection"
Note:. Don´t forget to enable the connect retry out too

Them to join the channel you can use the "Channel list" icon the icon that you have on mirc.

With that you can choose to coonnect automatcaly when join a network ( choosed by you ).

Hope this can help.
If this was not what you ask for it, sorry...

good luck


Not what I asked for at all. But, no need to be sorry for that! At least you wanted to help. smile
Posted By: gomp Re: On connect - 09/03/08 02:38 PM
Originally Posted By: RoCk

He means something like this...

Code:

on *:START: {
  server irc.accessirc.net -jn #br1,#ddayhome
  server -m irc.homelien.no -jn #chan1,#chan2,#chan3
  server -m irc.dal.net -jn #chan1,#chan2,#chan3
}



Replace #chan1 #chan2 #chan3 with whatever you want, or remove them altogether.

/help /server


HEhe.. It makes perfect sense now when I read what he said..

I am not familiar with the terminology used when scripting yet. But, I should have been able to grasp that one.

Thanks a lot! That is just what I need! smile

BTW: What does the n do? Would it be OK to just use:

server -m irc.dal.net -j #chan1,#chan2,#chan3

Instead of:

server -m irc.dal.net -jn #chan1,#chan2,#chan3

?

smile
Posted By: 5618 Re: On connect - 09/03/08 03:12 PM
I'm not sure, but if you look at /help /join it would suggest the -n switch in that part of the /server command minimizes the channels after joining them.
© mIRC Discussion Forums