westor

JClones ON NICK change (FIX) for Cappuccino v1.1

Nov 29th, 2021 (edited)
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.65 KB | None | 0 0
  1. ON !*:NICK: {
  2.   set -l %t $comchan($newnick,0)
  3.  
  4.   if (!%t) || ($network !== All4Masti) { return }
  5.  
  6.   set -l %i 1
  7.   while (%i <= %t)  {
  8.     set -l %c $comchan($newnick,%i)
  9.  
  10.     if (%c !== #test) { goto next }
  11.     if (!$nick(%c,$me,@&~%) && (o !isin $usermode) { goto next }
  12.  
  13.     jclones_nick_check $newnick %c $ial($newnick).host
  14.  
  15.     :next
  16.     inc %i
  17.   }
  18. }
  19.  
  20. alias jclones_nick_check {
  21.   ; /jclones_nick_check <nickname> <#channel> <host>
  22.  
  23.   if ($0 !== 3) { return }
  24.  
  25.   set -l %hash_1 JCLONES_ $+ $2
  26.   set -l %hash_2 JCLONESNICKS_ $+ $2
  27.  
  28.   set -l %nick_5chars $left($1,5)
  29.  
  30.   hinc -mu3 %hash_1 %nick_5chars 1
  31.   hadd -m %hash_2 $1 $3
  32.  
  33.   set -l %nick_total $hget(%hash_1,%nick_5chars)
  34.  
  35.   if (%nick_total > 1) {
  36.     if (!$timer([JCLONES_ [ $+ [ $2 ] $+ ] _LOCK])) {
  37.       ;echo $chan -g 01,08 ( cloned nicks Flood ) !!!!! Channel Locked !!!!!  
  38.  
  39.       .raw -q MODE $2 +MRb $+(%nick_5chars,*!*@*)
  40.  
  41.       .timer[JCLONES_ $+ $2 $+ _LOCK] 1 30 mode $unsafe($2) -MR
  42.     }
  43.  
  44.     set -l %t $hget(%hash_2,0).item
  45.  
  46.     if (%t) {
  47.       set -l %i 1
  48.       while (%i <= %t) {
  49.         set -l %n $hget(%hash_2,%i).item
  50.         set -l %h $hget(%hash_2,%n)
  51.  
  52.         if (%n) && (%h) && (* $+ %nick_5chars $+ * iswm %n) {
  53.           set -l %total_nicks $addtok(%total_nicks,%n,44)
  54.           set -l %total_hosts $addtok(%total_hosts,$+(*@,%h),32)
  55.         }
  56.  
  57.         inc %i
  58.       }
  59.  
  60.       if (%total_hosts) { pushmodex $2 $+(+,$str(b,$numtok(%total_hosts,32))) %total_hosts }
  61.       if (%total_nicks) { .raw -q KICK $2 %total_nicks !!! Indentical nicks !!! }
  62.     }
  63.  
  64.     if ($hget(%hash_1)) { hfree $v1 }
  65.     if ($hget(%hash_2)) { hfree $v1 }
  66.   }
  67. }
Add Comment
Please, Sign In to add comment