Auto-Join
Platform: mIRC
Published Jan 17, 2007
Updated Jan 29, 2007
A quick little code that will auto-join channels based on the network that you have connected to. Handy for those people that want to join a lot of channels when they connect, and keep seeing "Target change to fast"
Channels are added/removed via menu system and stored in a hash table based on the network name.
Note: I understand that some networks don't return a network name, but as I've been unable to find one, I don't know how this will work with networks like that.
on *:connect:{
if !$hget($network) { .hmake $network }
if $exists($+($network,.hsh)) { .hload $network $+($network,.hsh) }
var %a = 1, %b = $hget($network,0).item
while %a <= %b {
.timer 1 %a .join $hget($network,%a).item $iif($hget($network,%a).data,$v2)
inc %a
}
}
menu channel,nicklist {
Auto-Join Channels
.Add : .hadd -m $network $$input(Channel Name,e,,$chan) $?*="Key if required"
.Remove : .hdel $network $$input(Channel Name,e,,$chan)
.List : show $$input(Network Name,e,,$network)
}
alias -l show {
var %a = 1, %b = $hget($1,0).item
while %a <= %b {
set %chans $addtok(%chans,$hget($1,%a).item,32)
if $calc($len(%chans) + $numtok(%chans,32)) > 900 {
echo -a $replace(%chans,$chr(32),$+($chr(44),$chr(32)))
unset %chans
}
inc %a
}
if %chans {
echo -a $replace(%chans,$chr(32),$+($chr(44),$chr(32)))
unset %chans
}
}
on *:exit:{
.scon -at1 .hsave -o $!network $+($!network,.hsh)
}
on *:disconnect:{
.hsave -o $network $+($network,.hsh)
}