mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 6
S
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?

Joined: Feb 2004
Posts: 2,019
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.
Joined: Aug 2005
Posts: 6
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Aug 2005
Posts: 6
silly me...

Thanks a lot laugh

Joined: Aug 2005
Posts: 6
S
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?

Joined: Apr 2005
Posts: 1,009
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
Joined: Feb 2004
Posts: 2,019
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.
Joined: Aug 2005
Posts: 6
S
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..

Joined: Feb 2004
Posts: 2,019
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.
Joined: May 2005
Posts: 79
M
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

Joined: Aug 2005
Posts: 128
S
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 }

}

Joined: May 2005
Posts: 79
M
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

Joined: Aug 2005
Posts: 128
S
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.

Joined: Jun 2005
Posts: 30
_
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~


Link Copied to Clipboard