All pastes #463460 Raw Edit

Z

public text v1 · immutable
#463460 ·published 2007-04-28 23:34 UTC
rendered paste body
on *:KICK:#:{
  if ($knick == $me) {
    if ($chan == #bot) || ($chan == #bots) { halt }
    inc $+(%,blackkicks.,$chan)
    if ($($+(%,blackkicks.,$chan),2) > 5) {
      write blacklists.txt $chan
      unset $+(%,blackkicks.,$chan)
    }
  }
}
alias -l c1 { return $+($chr(3),03,$1-) }
alias -l c2 { return $+($chr(3),13,$1-) }
on me:*:JOIN:#:{
  var %chan = $chan
  msg $chan $c1(hello, to make me leave please use "4!part zedare", for help visit 3#pwntage or "7!help".thanks $($chan))
  if $read(blacklists.txt,w,$chan) {
    part $chan This channel has been blacklisted.I will not join this channel without permission. To request unblacklist: /ms send BotOwnerNick <Message>
  }
  else {
    if ($($+(%,blackkicks.,$chan),2)) {
      var %left = $+($calc(5 - $v1),/5)
    }
    else {
      var %left = 5/5
      msg $chan $c1(Number of kicks left:) $c2($($+(%,blackkicks.,$chan),2)) $c1(/) $c2(5)
    }
  }
}
on $*:TEXT:/[!.]add(black(list)?|ban)/Si:#:{
  var %file = blacklists.txt
  if ($me ison $2) && ($$2) && ($read(%file,w,$2) { part $chan This channel has been blacklisted, to discuss unblacklisting, please contact my bot owner.
    if ($address($nick,2) == $address($me,2) && $left($2,1) == $chr(35)) || ($nick == NICKNAME1) || ($nick == NICKNAME2) {
      if ($read(%file,w,$2)) { notice $nick $2 is already on the blacklist }
      else {
        write %file $2
        msg $chan $2 Was successfully written to the blacklist
      }
    }
  }
}
on $*:TEXT:/^[!.]del(black(list)?|ban)/Si:#:{
  var %file = blacklists.txt
  if ($address($nick,2) == $address($me,2) && $left($2,1) == $chr(35)) || ($nick == NICKNAME1) || ($nick == NICKNAME2) {
    if (!$read(%file,w,$2)) { notice $nick $2 is not on the blacklist }
    else {
      write $+(-ds,$2) %file
      msg $chan $2 Was successfully removed from the blacklist.
    }
  }
}