All pastes #623532 Raw Edit

Untitled

public text v1 · immutable
·published 2007-07-17 17:41 UTC
rendered paste body
on me:*:join:#:{
  if $hget(Blacklist,$+($network,.,$chan)) == $null {
    .hadd -m Blacklist $+($network,.,$chan) 3
    .hadd -m Blacklist $network $addtok($hget(Blacklist,$network),$chan,44)
  }
  elseif $hget(Blacklist,$+($network,.,$chan)) < 1 {
    .msg $chan This channel has been blacklisted
    .part $chan
  }
  else {
    .msg $chan If you kick me $hget(Blacklist,$+($network,.,$chan)) more time(s), your channel will be blacklisted !
  }
}

on *:kick:#:{
  if $knick == $me {
    .hdec -m Blacklist $+($network,.,$chan) 1
    if $hget(Blacklist,$+($network,.,$chan)) {
      .join $chan
    }
  }
}

on *:start:{
  if !$hget(Blacklist) { .hmake Blacklist 10 }
  if $exists(Blacklist.hsh) { .hload Blacklist Blacklist.hsh }
}
on *:exit:{
  .hsave -o Blacklist Blacklist.hsh
}
on *:disconnect:{
  .hsave -o Blacklist Blacklist.hsh
}
on *:connect:{
  if $hget(Blacklist,$network) > 0 {
    .join $hget(Blacklist,$network)
  }
}

on *:text:!remove*:*:{
  if ($nick == ancalagon_2) {
    if !$2 {
      .notice $nick 6No network or channel specified.
    }
    elseif !$3 {
      if $hfind(Blacklist,$+($2,.,*),0,w) {
        .hdel -w Blacklist $+($2,.,*)
        .notice $nick 6Network4 $2 6removed from 4blacklist6.
      }
      elseif $hfind(Blacklist,$+(*,.,$2),0,w) {
        .hdel -w Blacklist $+(*,.,$2)
        .notice $nick 6Channel4 $2 6removed from all networks on 4blacklist6.
      }
      else {
        .notice $nick $2 not found in blacklist.
      }
    }
    elseif $hfind(Blacklist,$+($2,.,$3),0) {
      .hdel Blacklist $+($2,.,$3)
      .notice $nick Channel $3 on network $2 removed from blacklist.
    }
    else {
      .notice $nick Channel $3 on network $2 not found on blacklist.
    }
  }
  .hsave -o Blacklist Blacklist.hsh
  .hload Blacklist Blacklist.hsh
}