All pastes #408587 Raw Edit

Anonymous

public text v1 · immutable
#408587 ·published 2007-03-24 23:10 UTC
rendered paste body
on 5:TEXT:*:*:{
  if ($1 == @idle) {
    if ($left($2,1) == $chr(35)) {
      if ($me !ison $2) {
        if (!$lines(idler.txt)) {
          .join $2
          .write idler.txt $2
          .notice $nick I am now idling $2 $+ . Channel has been written to idler.txt and will be auto-joined on connect.
        }
        else {
          var %x 1
          while (%x <= $lines(idler.txt)) {
            if (%x < $lines(idler.txt)) {
              if ($2 == $read(idler.txt,%x)) {
                .notice $nick This channel is already on your idler list but you are not currently on the channel. Now Joining channel.. If this doesn't work type .join $2 $+ .
                .join $2
                halt
              }
              elseif ($2 != $read(idler.txt,%x)) {
                inc %x
              }
            }
            elseif (%x == $lines(idler.txt)) {
              if ($2 == $read(idler.txt,%x)) {
                .notice $nick This channel is already on your idler list but you are not currently on the channel. Now Joining channel.. If this doesn't work type .join $2 $+ .
                .join $2
              }
              else {
                .join $2
                .write idler.txt $2
                .notice $nick I am now idling $2 $+ . Channel has been written to idler.txt and will be auto-joined on connect.
              }
              halt
            }
          }
        }
      }
      else {
        if (!$lines(idler.txt)) {
          .write idler.txt $2
          .notice $nick I am now idling $2 $+ . Channel has been written to idler.txt and will be auto-joined on connect.
        }
        else {
          var %x 1
          while ($lines(idler.txt)) {
            if (%x < $lines(idler.txt)) {
              if ($2 == $read(idler.txt,%x)) {
                .notice $nick You are already idling this channel.
              }
              elseif ($2 != $read(idler.txt,%x)) {
                inc %x
              }
            }
            elseif (%x == $lines(idler.txt)) {
              if ($2 == $read(idler.txt,%x)) {
                .notice $nick You are already idling this channel.
              }
              else {
                .write idler.txt $2
                .notice $nick Channel added to idler.txt. Join action not required. Reason: You are already on the channel.
              }
              halt
            }
          }
        }
      }
    }
    else {
      .notice $nick Channel must include pound sign. Invalid channel name.
    }
  }
  elseif ($1 == %trigger $+ join) {
    if ($left($2,1) == $chr(35)) {
      if ($me !ison $2) {
        .join $2
        .notice $nick Joining $2 $+ .
      }
      else {
        .notice $nick I am already idling $2
      }
    }
    else {
      .notice $nick Channel must include pound sign. Invalid channel name.
    }
  }
  elseif ($1 == @remidle) {    
    if ($left($2,1) == $chr(35)) {
      if ($me !ison $2) {
        var %x 1
        while (%x <= $lines(idler.txt)) {
          if (%x < $lines(idler.txt)) {
            if ($2 == $read(idler.txt,%x)) {
              .write -dl $+ %x idler.txt
              .notice $nick $2 Has been removed from idler.txt.
              halt
            }
            elseif ($2 != $read(idler.txt,%x)) {
              inc %x
            }
          }
          elseif (%x == $lines(idler.txt)) {
            if ($2 == $read(idler.txt,%x)) {
              .write -dl $+ %x idler.txt
              .notice $nick $2 Has been removed from idler.txt.
            }
            else {
              .notice $nick $2 could not be found in idler.txt. No action was taken.
            }
            inc %x
          }
        }
      }
      else {
        var %x 1
        while (%x <= $lines(idler.txt)) {
          if (%x < $lines(idler.txt)) {
            if ($2 == $read(idler.txt,%x)) {
              .write -dl $+ %x idler.txt
              .notice $nick $2 Has been removed from idler.txt. Now parting $2 $+ .
              .part $2
            }
            elseif ($2 != $read(idler.txt,%x)) {
              inc %x
            }
          }
          elseif (%x == $lines(idler.txt)) {
            if ($2 == $read(idler.txt,%x)) {
              .write -dl $+ %x idler.txt
              .notice $nick $2 Has been removed from idler.txt. Now parting $2 $+ .
              .part $2
            }

            else {
              .notice $nick $2 not found in idler.txt. Now parting $2 $+ .
              .part $2
            }
            inc %x
          }
        }
      }
    }
    else {
      .notice $nick Channel must include pound sign. Invalid channel name.
    }
  }
  elseif ($1 == @idlechans) || ($1 == .idlechannels) {
    .notice $nick $iif($idlechans,$v1,None)
  }
  elseif ($1 == @joinidle) {
    .notice $nick Now joining all IDLE channels. Type .idlechans or .idlechannels for complete list.
    var %x 1
    while (%x <= $lines(idler.txt)) {
      .timer $lines(idler.txt) 3 join $read(idler.txt,%x)
      inc %x
    }
  }
}
alias idleconnect {
  var %x 1
  while (%x <= $lines(idler.txt)) {
    .timer 1 3 join $read(idler.txt,%x)
    inc %x
  }
}
alias idlechans {
  var %idlechans
  var %x 1
  while (%x <= $lines(idler.txt)) {
    set %idlechans %idlechans $read(idler.txt,%x)
    inc %x
  }
  return %idlechans
}