tglogo.png
0 LIKES

Snippet


Anti-Mass-Nick-change by simo

In Category General IRC Posted by Snippets On 12/06/23

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
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 0


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand