if all of them are autojoin*-ish

Code:
on *:connect:{
  var %i = 1, %chans
  while ($hget(whatever, %i)) {
    %chans = $addtok(%chans, $ifmatch, 44)
    inc %i
  }
  join %chans
}


or if you have autojoin* and oithers:

Code:
on *:connect:{
  var %i = 1, %chans
  while ($hget(whatever, $hfind(whatever, autojoin*, %i, w))) { 
    %chans = $addtok(%chans, $ifmatch, 44)
    inc %i
  }
  join %chans
}


you can throw in an if() checking the network, or just switch it around for an alias