All pastes #831591 Raw Edit

Autojoin

public text v1 · immutable
#831591 ·published 2007-12-25 03:36 UTC
rendered paste body
alias /ajoin { 
  if (!$1) { 
    var %x = 1 
    while ($read(Join.txt,%x) != $null) { 
      join $read(Join.txt,%x) 
      inc %x 
    } 
  } 
  elseif ($1 == add) { 
    if (!$2 || $left($2,1) != $chr(35)) { halt } 
    write Join.txt $2 
    echo -a 14(03 $+ $time $+ 14) 03added14 $2 3to Ajoin list. 
  } 
  elseif ($1 == del) { 
    if ($read(Join.txt,w,$2) != $null) { 
      write -ds $+ $2 Join.txt 
      echo -a 14(03 $+ $time $+ 14) 03deleted14 $2 3from Ajoin list. 
    } 
    else { echo -a $2 is not on the list } 
  } 
  elseif ($1 == view) { 
    if ($lines(Join.txt) != $null) { 
      var %x = 1 
      while ($read(Join.txt,%x) != $null) { 
        echo -a %x $+ . $read(Join.txt,%x) 
        inc %x 
      } 
    } 
    else { echo -a The list is empty } 
  } 
  elseif ($1 == clear) { 
    if (!$lines(Join.txt)) { echo $active The AJoin list is not found } 
    else { 
      .remove Join.txt 
      echo -a 3(12 $+ $time $+ 3)12 $me cleared Ajoin list. 

    } 
  } 
} 
on *:CONNECT:{ 
  if ($lines(Join.txt) != $null) || if ($network == SwiftIRC { 
    var %x = 1 
    while ($read(Join.txt,%x)) { 
      join $read(Join.txt,%x) 
      inc %x 
    } 
  } 
}