Public paste
clonescanner mirc
By: clonescanner | Date: Mar 22 2011 02:09 | Format: None | Expires: never | Size: 4.49 KB | Hits: 554

  1. ; 末末末末末末末末末末末末末末末末末末末末
  2. ; NNScript by ESNation v4.22 - clone scanner - coded by greeny & mute
  3. ; Don't edit anything in here unless you REALLY know what you're doing!
  4. ; 末末末末末末末末末末末末末末末末末末末末
  5. alias cscan {
  6.   if (!$chan(0)) { errdialog you are not on any channel you could scan for clones! }
  7.   else {
  8.     if ($1 ischan) { set %cscan.pchan $1 }
  9.     nndlg -m clonescan
  10.   }
  11. }
  12. dialog clonescan {
  13.   title CloneScan on $curconserv [/cscan]
  14.   size -1 -1 364 206
  15.   option pixels
  16.   icon scriptspicsnntray.ico
  17.   box "Channel", 2, 4 0 144 48
  18.   combo 7, 12 16 128 144, sort size drop
  19.   box "Statistics", 5, 4 54 144 118
  20.   text "Total users", 15, 14 74 58 16
  21.   edit "", 14, 84 70 56 22, read autohs center
  22.   text "Clones", 8, 14 98 36 16
  23.   edit "", 9, 84 94 56 22, read autohs center
  24.   text "Percentage", 10, 14 122 62 16
  25.   edit "", 11, 84 118 56 22, read autohs center
  26.   text "Scan time", 12, 14 146 50 16
  27.   edit "", 13, 84 142 56 22, read autohs center
  28.   box "Clones (right-click for options)", 4, 156 0 204 172
  29.   list 6, 164 16 188 148, size
  30.   button "&Ok", 1, 280 178 80 24, ok
  31.   menu "&File", 17
  32.   item "&Close", 18, 17
  33.   menu "&Settings", 19
  34.   item "&Update IAL", 20, 19
  35.   item "&Refresh clones", 21, 19
  36. }
  37. on *:dialog:clonescan:*:*:{
  38.   if ($devent == init) {
  39.     mdx SetControlMDX $dname 6 TreeView haslines hasbuttons showsel nohscroll > $mdxfile(views)
  40.     var %c = $chan(0)
  41.     while (%c) {
  42.       did -a $dname 7 $chan(%c)
  43.       dec %c
  44.     }
  45.     did -c $dname 7 $iif($didwm(7,$iif(%cscan.pchan,$v1,$active)),$v1,1)
  46.     unset %cscan.pchan
  47.     cscan.do
  48.   }
  49.   elseif ($devent == sclick) {
  50.     if ($did == 7) { cscan.do }
  51.     elseif ($did == 6) {
  52.       tokenize 32 $did($did,1)
  53.       if ($1 == rclick) && ($5) {
  54.         did -i $dname $did 1 cb root $3-4
  55.         did -c $dname 6 $5
  56.         var %c = $did(7).seltext,%o = $iif(!$ccontrol(%c),+g,+),%n
  57.         noop $regsub($wd($gettok($gettok($did($did,$5),2,9),1,13),2),$+(/[,$prefix,]/g),,%n)
  58.         popdll.new
  59.         popdll.add 1    +g 1 0 $shorten(10,%n) $+ :
  60.         popdll.add 2    + 2 0 -
  61.         popdll.add 3    + 3 0 Whoiswe %n
  62.         popdll.add 4    + 4 0 -
  63.         popdll.add 5     $+ %o 5 0 Kickk %c %n Clones are not welcome in %c $+ !
  64.         popdll.add 6     $+ %o 6 0 Kickbankb %c %n Clones are not welcome in %c $+ , banned!
  65.         popdll.add 7     $+ %o 7 0 Timekickbantkb %c %n Clones are not welcome in %c $+ , tempbanned!
  66.         popdll.disp
  67.       }
  68.     }
  69.   }
  70.   elseif ($devent == menu) {
  71.     if ($did == 20) {
  72.       if ($remc(who)) { errdialog there is already another /who request going on. Please wait for it to finish. }
  73.       else { .who $did(7).seltext }
  74.     }
  75.     elseif ($did == 18) { dialog -c $dname }
  76.     elseif ($did == 21) { cscan.do }
  77.   }
  78. }
  79. alias cscan.do {
  80.   did -r clonescan 6
  81.   did -i clonescan 6 1 cb root
  82.   did -a clonescan 6 +be 1 1 0 0 0 Hostnames
  83.   did -i clonescan 6 1 cb last
  84.   var %m = $nnticks,%x = $did(clonescan,7).seltext,%s = $ialchan(*,%x,0),%c = 0,%v = $nick(%x,0)
  85.   did -ra clonescan 14 %v
  86.   if (%s != %v) {
  87.     did -a clonescan 6 + 1 1 0 0 0 IAL for %x not filled!
  88.     did -bra clonescan 9,11,13 n/a
  89.     did -b clonescan 4,5,6,8,10,12,14,15
  90.   }
  91.   else {
  92.     did -e clonescan 4,5,6,8,9,10,11,12,13,14,15
  93.     _hmake clonescan
  94.     while (%s) {
  95.       hinc clonescan *@ $+ $gettok($ialchan(*,%x,%s),2-,64)
  96.       dec %s
  97.     }
  98.     var %s = $hget(clonescan,0).item
  99.     while (%s) {
  100.       var %l = 1,%t = $hget(clonescan,%s).item,%h = $hget(clonescan,%t)
  101.       if (%h > 1) {
  102.         did -a clonescan 6 + 1 1 0 0 0 $+($gettok(%t,2-,64),    Host: $gettok(%t,2-,64),$cr,Users:) %h
  103.         did -i clonescan 6 1 cb last
  104.         while (%l <= %h) {
  105.           var % = $ialchan(%t,%x,%l).nick,%g = $iif(% !isreg %x,$left($nick(%x,%).pnick,1)) $+ %
  106.           did -a clonescan 6 + 1 1 0 0 0 $+(%g, Nickname: $ialchan(%t,%x,%l).nick,$cr,Clone #: %l,/,%h,$cr,Address: $gettok($ialchan(%t,%x,%l),2-,33),$cr,Idle) time: $sduration($nick(%x,%).idle)
  107.           inc %l
  108.         }
  109.         did -i clonescan 6 1 sort
  110.         did -i clonescan 6 1 cb up
  111.         inc %c $calc(%h -1)
  112.       }
  113.       dec %s
  114.     }
  115.     if (!%c) { did -a clonescan 6 + 1 1 0 0 0 No clones on %x found. }
  116.     else { did -i clonescan 6 1 sort }
  117.     did -ra clonescan 9 %c
  118.     did -ra clonescan 11 $percent(%c,$nick(%x,0),0)
  119.     did -ra clonescan 13 $round($calc($nnticks - %m),2) $+ s
  120.     hfree clonescan
  121.   }
  122. }
  123. ; 末末末末末末末末末末末末末末末末末末末末
  124. ; End of file
  125. ; 末末末末末末末末末末末末末末末末末末末末