on *:start: {
hmake home 100
hadd home #channel1 1
hadd home #channel2 1
etc.
}
on *:connect: {
var %cnt = 1
var %total = $hget(home,0).item
while (%cnt <= %total) {
join $hget(home,%cnt).data
inc %cnt
}
}
on *:part:#: {
if ($hget(home,$chan)) { rejoin }
}
You basically had your entire script done.
Anyhow, you might want to use /hsave and /hload as well if you don't want to /hadd the same channels every time you start mIRC.
And, if you have enough channels listed, it may not be possible to join them all that quickly and you may have to use a timer in the join code.