All pastes #508149 Raw Edit

Something

public text v1 · immutable
·published 2007-05-24 21:47 UTC
rendered paste body
on *:JOIN:#:{
  if ($nick == $me) {
    if ($lines(autojoin.txt) != 30) { 
      if ($read(autojoin.txt, w, $chan)) {
      /echo -a i read the chan }
      else {
        write autojoin.txt $chan
        timer 1 1 msg $chan Added to my auto join :)
      }
    }
    else {
      echo -a $chan couldnt be added to auto join
    }
  }
}

alias ajlist {
  var %x = 1
  while (%x >= $lines(autjoin.txt)) {
    if ($read(autojoin.txt, %x) == $null) {
      /echo -a -- list complete --
    halt }
    else {
      /echo -a $read(autojoin.txt, %x)
      inc %x
    }
  }
}
alias aj {
  var %x = 1
  while (%x >= $lines(autjoin.txt)) {
    if ($read(autojoin.txt, %x) == $null) {
      /echo -a Joining complete
    halt }
    else {
      /join $read(autojoin.txt, %x)
      inc %x
    }
  }
}

alias addaj {
  if ($read(autojoin.txt, w, $1)) {
    echo -a This chan ( $+ $1 $+ ) already on autojoin
    halt
  }
  if ($lines(autojoin.txt) == 30) { 
    .echo -a list full
  }
  else {
    write autojoin.txt $1
    /echo -a $1 Added to my auto join 
  }
}
alias delaj {
  if (!$read(autojoin.txt, w, $1)) {
    echo -a This chan ( $+ $1 $+ ) is not on autojoin
    halt
  }
  else {
    write -ds $+ $1 autojoin.txt
    /echo -a $1 deleted from my auto join 
  }
}
alias clrlist {
  write -c autojoin.txt
  /echo -a -- list cleared --
}