All pastes #755052 Raw Edit

tim kearns

public text v1 · immutable
#755052 ·published 2007-10-30 12:59 UTC
rendered paste body
alias ajoin {
  if ($1 == add) {
    if ($read(auto-join.txt,w,$2*)) { echo -ta --- (Auto Join) $2 already on auto-join list. | halt }
    write auto-join.txt $2-
    echo -ta --- (Auto Join) $2 added to auto join. Key: $iif($3,$3,None.)
  }
  if ($1 == del) {
    if (!$read(auto-join.txt,w,$2*)) { echo -ta --- (Auto Join) $2 not found on auto-join list. | halt }
    write -dw auto-join.txt $2*
    echo -ta --- (Auto Join) $2 del'd from auto-join.
  }
  if ($1 == list) {
    var %i = 1
    while ($read(auto-join.txt,%i)) {
      var %k = %k $read(auto-join.txt,%i)
      inc %i
    }
    echo -ta --- (Auto Join List) $iif(%k,%k,No channels on auto-join.)
  }
  if (!$1) {
    var %i = 1 
    while ($read(auto-join.txt,%i)) { 
      join $read(auto-join.txt,%i) 
      inc %i 
    }
  }
}