mIRC Home    About    Download    Register    News    Help

Print Thread
multiple chan problem #227635 16/11/10 10:55 PM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
aloha
i'm still using good old 6.21

so my question is this for scripting
how to join multiple channels at once
if I have lets say in %chans set channels
/set %chans #chan1 #chan2

and I want simple /join %chans

same goes for on join event
how to make it work for same variable with multiple channels set ?

Re: multiple chan problem [Re: vinifera] #227637 17/11/10 12:23 AM
Joined: Nov 2009
Posts: 81
V
Voglea Offline
Babel fish
Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
/set %chans #chan1,#chan2

or

/join $replace(%chans,$chr(32),$chr(44))

Re: multiple chan problem [Re: vinifera] #227638 17/11/10 12:26 AM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Syntax for multiple channels are delimited by commas.

/join #chan1,#chan2,#chan3

You can also use the server command.

/server irc.site.net 6667 -j #chan1,#chan2,#chan3

You want an on join event that then joins other channels from a variable? I would suggest deciding what channels you want to join and join them all at once.

Otherwise:

Code:
/set %var #chan1,#chan2,#chan3
Or
menu channel {
Auto-Join Channel
.Add:set %var $addtok(%var,#,44)
.$iif($istok(%var,#,44),Remove) :set %var $remtok(%var,#,44)
}

on me:*:join:#:join %var

Re: multiple chan problem [Re: DJ_Sol] #228264 14/12/10 02:30 AM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
hmm

is it valid for on join event be used
still if %var has #chan1 #chan2 ...

Code:
on !@*:join:#:{
if ($chan isin %var) { do whatever specific for those chans }
}


?

Re: multiple chan problem [Re: vinifera] #228268 14/12/10 07:01 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Using $chan isin %var is dangerous if you are in two channels that are similar, e.g. #trivia and #trivia-help

If #trivia-help is in the %var then (#trivia isin %var) will also be true. Granted, it's not very likely, but a real possibility still.

You're better off using the $istok identifier. For instance $istok(%var,$chan,44) if your channels are separated by token 44 (commas).

Re: multiple chan problem [Re: 5618] #228269 14/12/10 08:18 AM
Joined: Jun 2009
Posts: 91
V
vinifera Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 91
oh I like that laugh

thanks all