ON ^*:text:*:#:{
  if ($nick(#,$me,@&~%)) {
    var %h = $hash($lower($strip($left($1-,400))),32)
    if (!$nick($chan,$nick,@&~%)) {
      if (%protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ] < 70) inc -z %protect.r. $+ $chan $+ . $+ %h 10
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ]
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.j. [ $+ [ $chan ] $+ . $+ [ $chan ] ]
    }
    if (%protect.r. [ $+ [ $chan ] $+ . $+ [ $chan ] $+ . $+ [ %h ] ] > 2) {
    set -u15 %reptxt1 $addtok(%reptxt1,$nick,44)
     if (%modechanRep != $true) {
        .raw mode  $chan +MR
        echo $chan 01,08 ( Mass Text Repeat Flood Detected ) !!!!! Channel Locked !!!!!
        set -u5 %modechanRep $true
        set -u5 %reptxt2 1
        .timerreptxt 1 30 mode $chan -MR
      }
      while (%reptxt2 <= $numtok(%reptxt1,44)) {
        if ($gettok(%reptxt1,%reptxt2,44) ison $chan) {
            ban35 $gettok(%reptxt1,%reptxt2,44) $chan
          if (%reptxt2 <=  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -1-  }
          if (%reptxt2 >  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -2-  }
        }
        inc %reptxt2
      }
    }
  }
}

ON ^*:action:*:#:{
  if ($nick(#,$me,@&~%)) {
    var %h = $hash($lower($strip($left($1-,400))),32)
    if (!$nick($chan,$nick,@&~%)) {
      if (%protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ] < 70) inc -z %protect.r. $+ $chan $+ . $+ %h 10
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ]
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.j. [ $+ [ $chan ] $+ . $+ [ $chan ] ]
    }
    if (%protect.r. [ $+ [ $chan ] $+ . $+ [ $chan ] $+ . $+ [ %h ] ] > 2) {
     set -u5 %reptxt1 $addtok(%reptxt1,$nick,44)
     if (%modechanRep != $true) {
        .raw mode  $chan +MR
        echo $chan 01,08 ( Mass Text Repeat Flood Detected ) !!!!! Channel Locked !!!!!
        set -u5 %modechanRep $true
        set -u5 %reptxt2 1
        .timerreptxt 1 30 mode $chan -MR
      }
      while (%reptxt2 <= $numtok(%reptxt1,44)) {
        if ($gettok(%reptxt1,%reptxt2,44) ison $chan) {
              ban35 $gettok(%reptxt1,%reptxt2,44) $chan
          if (%reptxt2 <=  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -1-  }
          if (%reptxt2 >  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -2-  }
        }
        inc %reptxt2
      }
    }
  }
}

ON ^*:notice:*:#:{
  if ($nick(#,$me,@&~%)) {
    var %h = $hash($lower($strip($left($1-,400))),32)
    if (!$nick($chan,$nick,@&~%)) {
      if (%protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ] < 70) inc -z %protect.r. $+ $chan $+ . $+ %h 10
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.r. [ $+ [ $chan ] $+ . $+ [ %h ] ]
      inc -z %protect.r. $+ $chan $+ . $+ $chan $+ . $+ %h %protect.j. [ $+ [ $chan ] $+ . $+ [ $chan ] ]
    }
    if (%protect.r. [ $+ [ $chan ] $+ . $+ [ $chan ] $+ . $+ [ %h ] ] > 2) {
    set -u5 %reptxt1 $addtok(%reptxt1,$nick,44)
      if (%modechanRep != $true) {
        .raw mode  $chan +MR
        echo $chan 01,08 ( Mass Repeat Notice Flood Detected ) !!!!! Channel Locked !!!!!
        set -u5 %modechanRep $true
        set -u5 %reptxt2 1
        .timerreptxt 1 30 mode $chan -MR
      }
      while (%reptxt2 <= $numtok(%reptxt1,44)) {
        if ($gettok(%reptxt1,%reptxt2,44) ison $chan) {
          ban35 $gettok(%reptxt1,%reptxt2,44) $chan
          if (%reptxt2 <=  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -1-  }
          if (%reptxt2 >  5) { kick $chan $gettok(%reptxt1,%reptxt2,44) Dont repeat please thank you -2-  }
        }
        inc %reptxt2
      }
    }
  }
}

alias ban35 {
if ($regex($address($1,2),/(irccloud)/i)) {
    mode $2 +b $regsubex($mid($address($1,0),3),/(~?[^@]+)@.*(?=\.[^.]+\..+)/,*!\1@*\2)   
     halt
}
elseif (!$regex($gettok($address($1,2),-1,64),/[a-zA-Z]/g)) {
    mode $2 +b $+($gettok($address($1,2),1-3,46),.*)
}   
  else {
    mode $2 +b $+(*!*@*.,$gettok($address($1,2),2-,46))
}
}