mIRC Home    About    Download    Register    News    Help

Print Thread
on connect not working properly :( #127423 13/08/05 04:32 PM
Joined: Aug 2005
Posts: 6
S
SoothingR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2005
Posts: 6
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?

Re: on connect not working properly :( #127424 13/08/05 04:34 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Re: on connect not working properly :( #127425 13/08/05 04:36 PM
Joined: Aug 2005
Posts: 6
S
SoothingR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2005
Posts: 6
silly me...

Thanks a lot laugh

Re: on connect not working properly :( #127426 13/08/05 05:30 PM
Joined: Aug 2005
Posts: 6
S
SoothingR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2005
Posts: 6
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?

Re: on connect not working properly :( #127427 13/08/05 05:42 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
on *:connect:{
if ($network == blah) { join #chan1,#chan2 }
elseif ($network == bleh) { join #woot1,#woot2 }
elseif ($network == ...) { ... }
}

:P


IceCapped
Re: on connect not working properly :( #127428 13/08/05 05:44 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Re: on connect not working properly :( #127429 13/08/05 05:56 PM
Joined: Aug 2005
Posts: 6
S
SoothingR Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2005
Posts: 6
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..

Re: on connect not working properly :( #127430 13/08/05 06:02 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Re: on connect not working properly :( #127431 13/08/05 06:15 PM
Joined: May 2005
Posts: 79
M
Mary_juana Offline
Babel fish
Offline
Babel fish
M
Joined: May 2005
Posts: 79
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

Re: on connect not working properly :( #127432 13/08/05 07:33 PM
Joined: Aug 2005
Posts: 128
S
stefys99 Offline
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
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 }

}

Re: on connect not working properly :( #127433 13/08/05 07:38 PM
Joined: May 2005
Posts: 79
M
Mary_juana Offline
Babel fish
Offline
Babel fish
M
Joined: May 2005
Posts: 79
Some of the networks i go on, don't have a network name configured properly, so that's why i use inin $server

Re: on connect not working properly :( #127434 13/08/05 07:43 PM
Joined: Aug 2005
Posts: 128
S
stefys99 Offline
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Ok then.. but I don't understand how the networks names are changed everytime, but whatever.

Re: on connect not working properly :( #127435 15/08/05 06:25 AM
Joined: Jun 2005
Posts: 30
_
_DuDe_ Offline
Ameglian cow
Offline
Ameglian cow
_
Joined: Jun 2005
Posts: 30
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~