try to change this:
Code:
alias joinchans if ($network == undernet) {
  var %c = 1
  while $read(file.txt,n,%c) {
    $+(.timer,join.,$cid,.,$v1) 1 $calc(%c  2) join $v1
    inc %c
  }
} 

to this:
Code:
alias joinchans {
  if (undernet isin $network) {
    var %c = 1
    while $read(file.txt,n,%c) {
      $+(.timer,join.,$cid,.,$v1) 1 $calc(%c  2) join $v1
      inc %c
    }
  } 
}

should work laugh