Loading

Clone Detector

  1. ; #################################################################
  2. ; ## Simple Clone detector                                       ##
  3. ; ## Written by Urza (Urza23@hotmail.com)                        ##
  4. ; ## Written and tested in mIRC 6.16/6.17                        ##
  5. ; #################################################################
  6.  
  7. menu channel,menubar {
  8.   Clone Detection settings
  9.   .$iif($group(#CloneDetect) == on,Disable,Enable) clone scan on join: {
  10.     var %status = $iif($group(#CloneDetect) == on,Disable,Enable)
  11.     $+(.,%status) #CloneDetect
  12.     echo 7 -at * On join clone scanning $+(%status,d.) Users will $iif(%status == Disable,no longer,now) be scanned for clones when they join
  13.   }
  14.   .$iif($active ischan,Scan for clones in $active):CloneScan
  15. }
  16. #CloneDetect on
  17. on *:join:#: {
  18.   if ($address($nick,2) == $address($me,2)) halt
  19.   if ($read(allowedhost.txt,w,$address($nick,2))) halt
  20.   if ($ial($address($nick,2),0) > 1) {
  21.     var %x = 1
  22.     while (%x <= $ial($address($nick,2),0)) {
  23.       var %clones = $iif(%clones,%clones &) $ial($address($nick,2),%x).nick
  24.       inc %x
  25.     }
  26.     echo 10 -t $chan [Clones Detected] %clones @ $site
  27.   }
  28. }
  29. #CloneDetect end
  30. alias CloneScan {
  31.   if ($1 == on) {
  32.     if ($group(#CloneDetect) == on) Echo 4 -at Clone Scanning on join is already enabled
  33.     else {
  34.       .enable #CloneDetect
  35.       echo 7 -at * On join clone scanning Enabled. Users will now be scanned for clones when they join
  36.     }
  37.   }
  38.   elseif ($1 == off) {
  39.     if ($group(#CloneDetect) == off) Echo 4 -at Clone Scanning on join is already disabled
  40.     else {
  41.       .disable #CloneDetect
  42.       echo 7 -at * On join clone scanning Disabled. Users will no longer be scanned for clones when they join
  43.     }
  44.   }
  45.   elseif ($active !ischan) echo 4 -a ERROR: You need to scan in a channel
  46.   else {
  47.     who $chan
  48.     var %nicks = $nick($chan,0), %x = 0
  49.     while (%x <= %nicks) {
  50.       var %host = $address($nick($chan,%x),2)
  51.       if (%host != $address($me,2)) && (!$read(allowedhost.txt,w,%host)) {
  52.         if ($ialchan(%host,$chan,0) > 1) && (!$istok(%clone.hosts,%host,44)) {
  53.           var %y = 1, %clones = $ialchan(%host,$chan,0), %clones.found = yes
  54.           while (%y <= %clones) {
  55.             var %nick = $gettok($ialchan(%host,$chan,%y),1,33)
  56.             var %clone.nicks = $iif(%clone.nicks,%clone.nicks &) %nick
  57.             inc %y
  58.           }
  59.           echo 10 -a [Clones Detected] %clone.nicks @ $gettok(%host,2,64)
  60.           var %clone.hosts = $addtok(%clone.hosts,%host,44)
  61.           unset %clone.nicks
  62.         }
  63.       }
  64.       inc %x
  65.     }
  66.     if (!%clones.found) echo 10 -a No clones found
  67.   }
  68. }

Comments