mIRC Home    About    Download    Register    News    Help

Print Thread
#227635 16/11/10 10:55 PM
Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
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 ?

Joined: Nov 2009
Posts: 81
V
Babel fish
Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
/set %chans #chan1,#chan2

or

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

Joined: Jan 2007
Posts: 1,156
D
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

Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
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 }
}


?

Joined: Jun 2007
Posts: 933
5
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).

Joined: Jun 2009
Posts: 96
V
Babel fish
OP Offline
Babel fish
V
Joined: Jun 2009
Posts: 96
oh I like that laugh

thanks all


Link Copied to Clipboard