All pastes #744415 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-21 13:52 UTC
rendered paste body
on *:text:!floodon:#:{
  if ($nick isop $chan) || ($address($nick,2) = $address($me,2)) {
    if (%floodchan) {
      notice $nick flood protection is already on for $chan
    }
    else {
      set %floodchan $addtok(%floodchan,$chan,44)
      msg $chan 4Flood protection is now on for $chan
    }
  }
}
on *:text:!floodoff:#:{
  if ($nick isop $chan) || ($address($nick,2) = $address($me,2)) {
    if (%floodchan) {
      set %floodchan $remtok(%floodchan,$chan,1,44)
      msg $chan 4Flood protection is now off for $chan
    }
    else {
      notice $nick Flood protection is already turned off for $chan
    }
  }
}
on *:text:*:%floodchan: {
  if ($nick isop $chan) || ($address($nick,2) = $address($me,2)) {
    hadd -mu10 chanflood $+($nick,.,$chan,.,$ticks) 1
    if ($hfind(chanflood,$+($nick,.*),0,w) > 4) {
      If ($nick isop $chan) || ($nick ishop $chan) || ($address($nick,2) = $address($me,2)) {
        notice [Foe]Bot $nick is spamming
      }
      Else {
        ban $+(-,ku,$calc(60)) $chan $nick FLOOD (1 Minute Ban)
      }
    }
  }
}