Anti-Mass-Nick-change

By simo on May 22, 2017

this will get rid of mass nick changes on channel and also will check for irccloud host and ban appropriately

credits go to Neo Nemesis i modified his code a bit

By Cappuccino.

ON  *:nick: {
  set -u3 %mjn1 $addtok(%mjn1,$newnick,44)
  var %ecnt8NX = 1
  while ( $comchan($newnick,%ecnt8NX) != $null )  {
    var %nickfldchan $v1
    hinc -mu3 massnick %nickfldchan 1
    if ($nick(%nickfldchan,$me,@%&~)) {
      if ($hget(massnick,%nickfldchan) > 2) {
        if (%nickschan != $true) {
          echo %nickfldchan 08,12 Nick-Flood Detected 
          .raw mode %nickfldchan +MR
          .set -u3 %nickschan $true
          set -u3 %mjn2 1
          .timermjnR 1 30 mode %nickfldchan -R
          .timermjnM 1 120 mode %nickfldchan -M          
}
        while (%mjn2 <= $numtok(%mjn1,44)) {
          if ($gettok(%mjn1,%mjn2,44) ison %nickfldchan) {
            ban35RT $gettok(%mjn1,%mjn2,44) %nickfldchan  
            if (%mjn2 <=  15) { kick %nickfldchan $gettok(%mjn1,%mjn2,44) Mass Nick-Change Detected  -1- } 
            if (%mjn2  >= 16) { kick %nickfldchan $gettok(%mjn1,%mjn2,44) Mass Nick-Change Detected -2- } 
          }
          inc %mjn2
        }
      }
    }
    inc %ecnt8NX
  }
}

Alias ban35RT {
 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))  
  } 
}

ON *:LOAD:{ hmake massnick 100  }
On *:start: { hmake massnick 100 }

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.