mIRC Homepage
Posted By: SoothingR on connect not working properly :( - 13/08/05 04:32 PM
This is what I have:

Code:
on *:CONNECT:if $network == Windfyre { /j #zfgc | /j #zelda | /j #gaming | /j #insane }
on *:CONNECT:if $network == Scoutlink { /j #dutch | /j english }
on *:CONNECT:if $network == umbranet { /j #withintemptation }


The problem is, the on connect only works when I'm connecting to Windfyre, it doesn't work with any of the other networks... Can anybody tell me how to fix this?
Posted By: FiberOPtics Re: on connect not working properly :( - 13/08/05 04:34 PM
That's because only the first event is ever reached.

Group them into one single event, and use if conditions.

An example:

Code:
on *:connect:{
  if ($network == blah) join #chan1,#chan2
  elseif ($network == bleh) join #woot1,#woot2
  elseif ($network == ...) ...
}


Note, I'm joining multiple channels in one command. This is possible on a lot of networks, but some may not support this at all. If the specific networks don't support it, then use your approach with pipes like: join #chan | join #anotherchan etc.
Posted By: SoothingR Re: on connect not working properly :( - 13/08/05 04:36 PM
silly me...

Thanks a lot laugh
Posted By: SoothingR Re: on connect not working properly :( - 13/08/05 05:30 PM
It didn't work..

When I joined a network, it joined all the channels that were on all the if- and else-if lines.

Anybody know how to fix that?
Posted By: raZOR Re: on connect not working properly :( - 13/08/05 05:42 PM
on *:connect:{
if ($network == blah) { join #chan1,#chan2 }
elseif ($network == bleh) { join #woot1,#woot2 }
elseif ($network == ...) { ... }
}

:P
Posted By: FiberOPtics Re: on connect not working properly :( - 13/08/05 05:44 PM
That's impossible.

My guess is you did not copy the code correctly to your scripts editor. The forums sometimes have a bug where they'll put all code on a line when copying. To help it, you can first paste to wordpad, and then to the editor, or click "Quote" from my post, and copy it from that window.

@razor: that will do exactly what my code did, no difference, braces or not.
Posted By: SoothingR Re: on connect not working properly :( - 13/08/05 05:56 PM
Quote:
@razor: that will do exactly what my code did, no difference, braces or not.
Actually, I copied the whole thing again and it didn't work...then I tried razor's suggestion; and adding those brackets did work..
Posted By: FiberOPtics Re: on connect not working properly :( - 13/08/05 06:02 PM
Wrong.

Those braces have nothing to do with it. Btw ( ) are brackets, { } are braces.

You must have miscopied it, no doubt. Note that razor did not use the code tags, which means if you copy his code, it will be pasted correctly in all occasions. However as stated, when copying code from within code tags, like mine, there's almost a 100% chance, when pasting it doesnt come out right.
Posted By: Mary_juana Re: on connect not working properly :( - 13/08/05 06:15 PM
Code:
on *:connect:{
  if (dijitalgods isin $server) { .raw join #blah | halt }
  if (vidgamechat isin $server) { .raw join #blah,#blah | halt }
  if (chatshack isin $server) {  .raw join #blah,#blah,#blah | halt }
}  


that works for me smirk
Posted By: stefys99 Re: on connect not working properly :( - 13/08/05 07:33 PM
Quote:
Code:
on *:connect:{
  if (dijitalgods isin $server) { .raw join #blah | halt }
  if (vidgamechat isin $server) { .raw join #blah,#blah | halt }
  if (chatshack isin $server) {  .raw join #blah,#blah,#blah | halt }
}  


that works for me smirk

Do not use isin:
Code:
on *:CONNECT:{

if ($network == Windfyre) { /j #zfgc | /j #zelda | /j #gaming | /j #insane }

elseif ($network == Scoutlink) { /j #dutch | /j #english }

elseif ($network == umbranet) { /j #withintemptation }

}
Posted By: Mary_juana Re: on connect not working properly :( - 13/08/05 07:38 PM
Some of the networks i go on, don't have a network name configured properly, so that's why i use inin $server
Posted By: stefys99 Re: on connect not working properly :( - 13/08/05 07:43 PM
Ok then.. but I don't understand how the networks names are changed everytime, but whatever.
Posted By: _DuDe_ Re: on connect not working properly :( - 15/08/05 06:25 AM
Quote:
Ok then.. but I don't understand how the networks names are changed everytime, but whatever.


^ My network has 2 network names because one of the net-admins are very stubborn and he refuses to change his network (personally I think he forgot how, and is to proud to ask for help, but his choice).

I have also been on servers very badly run and each server was the same network, but they numbered the networks. {ex. Server.1.com <Johnny> | Server.2.com <Johnny1> | Server.3.com <Johnny2> (Where the stuff in < > 's is the network name)}

~mike~
© mIRC Discussion Forums