Enigma Bot — File Browser

EnigmaBotv1.4 / EnigmaBotv1.4 / Enigma versione1_4 / Addons / clone scan / scan-c.mrc

scan-c.mrc — 10.51 KB — Download this file

;==============================================================================================================
;Scan-C v 1.0 by Shikkie
;Date: 06/26/2001
;==============================================================================================================
dialog sc.hlp {
  title "Scan-C Readme"
  option dbu
  size -1 -1 200 150
  edit "", 1, 5 5 190 140, multi read vsbar
  button "", 90, 0 0 0 0, cancel
}
on *:dialog:sc.hlp:init:0: {  loadbuf -o sc.hlp 1 $scriptdirscan-c-readme.txt }
alias -l sc.hlp { dialog -m sc.hlp sc.hlp }
alias -l sc.hlp.ask { if ($?!="Display Scan-C Help File?" == $true) { sc.hlp } }
;==============================================================================================================
dialog sc.options {
  title "Scan-C Options"
  size -1 -1 102 78
  option dbu
  check "&Check every time a person joins", 1, 6 12 90 11
  radio "&Show in channel", 2, 16 26 50 10, group
  radio "Show in @window", 3, 16 36 60 10
  radio "Popup Dialog", 4, 16 46 50 10
  button "Close", 5, 64 64 37 12, cancel
  box "Auto Scan", 6, 2 1 98 58
}
alias -l sc.options { dialog -m sc.options sc.options }
on *:dialog:sc.options:init:0: {
  did - $+ $iif(%sc.options.autoscan == 1,c,u) sc.options 1
  did - $+ $iif(%sc.options.autoscan == 1,e,b) sc.options 2,3,4
  did - $+ $iif(%sc.options.dformat == chan,c,u) sc.options 2
  did - $+ $iif(%sc.options.dformat == window,c,u) sc.options 3
  did - $+ $iif(%sc.options.dformat == dialog,c,u) sc.options 4
}
on *:dialog:sc.options:sclick:*: {
  if ($did == 1) { 
    set %sc.options.autoscan $did($dname,$did).state 
    did - $+ $iif(%sc.options.autoscan == 1,e,b) sc.options 2,3,4
  }
  if ($did == 2) { set %sc.options.dformat chan }
  if ($did == 3) { set %sc.options.dformat window }
  if ($did == 4) { set %sc.options.dformat dialog }
}
;==============================================================================================================
alias -l sc.getnicks {
  ;-- $mask(mask,2)
  var %i = 0, %targ = $ial($$1,0)
  var %str = $null
  while (%i < %targ) {
    inc %i 1
    %str = %str $ial($$1,%i).nick
  }
  return $sorttok(%str,32)
}
menu @sc.clones {
  dclick:close -@ @sc.clones
  &Dns Host:dns $gettok($sline(@sc.clones,1),3,9)
  -
  &Auto-Alert:sc.options
  &Scan all on %sc.options.current: sc.quickscan %sc.options.current
  -
  &Close:close -@ @sc.clones
}
dialog sc.popup {
  title "Scan-S"
  size -1 -1 212 61
  option dbu
  text "clone found", 1, 2 2 193 10, center
  text "Channel", 2, 28 13 196 10
  text "Host", 3, 28 25 189 10
  text "Nicks", 4, 28 37 187 10
  button "Close", 5, 172 49 37 12, cancel
  text "Channel:", 6, 2 13 21 8, right
  text "Host:", 7, 2 25 21 8, right
  text "Nicks: ", 8, 2 37 21 8, right
  button "&Scan for all", 90, 131 49 37 12,ok
}
on *:dialog:sc.popup:init:0: { dialog -t $dname $sc.dlg.title | did -f $dname 1 }
on *:dialog:sc.popup:sclick:90: { sc.quickscan %sc.options.current }
;==============================================================================================================
alias -l sc.autoscan {
  if (%sc.options.autoscan == 1) {
    set %sc.options.current $$1
    ;    echo $$1 $1-
    var %clones = $ialchan($mask($$3,2),$$1,0)
    if (%clones > 1) { 
      if (%sc.options.dformat == chan) {
        echo $colour(info) $$1 4----------------ยป 14CloNe-ScaN:  $+ %clones $+  clones from 4-[ $+ $right($mask($$3,2),-4) ]- $+ $chr(40) $+ $sc.getnicks($mask($$3,2)) $+ $chr(41)
      }
      else {
        if (%sc.options.dformat == window) { 
          if ($window(@sc.clones) == $null) { window -alk0 -t5,20,55,40 +lnxe @sc.clones 25 100 $calc($window(-1).w - 50) 100 verdana 10 }
          else { clear -l @sc.clones }
          aline -l $colour(background)  @sc.clones sadf
          aline -l $colour(info) @sc.clones Scan-C has detected the following new clone on $$1 $+ .
          aline -l $colour(background)  @sc.clones sadf
          aline -l @sc.clones Num $ch9 Chan $ch9 Host $ch9 Nicks
          aline -l @sc.clones $str(-,150)
          aline -l @sc.clones %clones $ch9 $$1 $ch9 $right($mask($$3,2),-4) $ch9 $sc.getnicks($mask($$3,2)) 
          sline -l @sc.clones 6
        }
        else {
          if (%sc.options.dformat == dialog) {
            dialog -m sc.popup sc.popup
            did -ra sc.popup 1 Scan-C has detected the following new clone on $$1 $+ .
            did -ra sc.popup 2 $$1
            did -ra sc.popup 3 $right($mask($$3,2),-4)
            did -ra sc.popup 4 $sc.getnicks($mask($$3,2)) 
          }
        }
      }
    }
  }
}
;==============================================================================================================
dialog sc.invite {
  title "Scan-C: Invite"
  size -1 -1 86 56
  option dbu
  text "ADFASDFSDF", 1, 3 4 81 10
  combo 2, 8 17 70 68, size drop sort
  edit "", 5, 0 0 0 0, hide
  button "&Invite", 3, 5 35 37 12, ok
  button "&Cancel", 4, 46 35 37 12, cancel
}
alias -l sc.invite { set -u2 %sc.config.invite $$1 | dialog -m sc.invite sc.invite }
on *:dialog:sc.invite:init:0: {
  did -ra sc.invite 1 Invite: %sc.config.invite to.. |  did -ra sc.invite 5 %sc.config.invite
  var %i = 0
  while (%i < $chan(0)) {
    inc %i 1
    if ($me isop $chan(%i)) { did -a sc.invite 2 $chan(%i) }
  }
  did -c sc.invite 2 1
}
on *:dialog:sc.invite:sclick:3: { .invite $did($dname,5) $did($dname,2).seltext }
;==============================================================================================================
alias -l ch9 { return $chr(9) }
alias -l mdx { return $dll($scriptdirmdx.dll,$$1,$2-) }
alias -l mdx.dlg {  did -i sc $iif($$1 == clist,1,2) 1 $2- }
alias -l mdx.aline { did -a sc $iif($$1 == clist,1,2) $2- }
alias -l sc.dlg.title { return Scan-C v $+ $sc.version by Shikkie }
alias -l sc.version { return 1.0 }
alias -l sc.clones.seltext { return $gettok($did(sc,2).seltext,6,32) }
alias -l sc.who { .enable #sc.who | .who $chan }

; dialog table generated by Dialog Studio

dialog sc {
  title "Scan-C"
  size -1 -1 246 128
  option dbu
  combo 10, 27 113 75 50, sort size drop
  list 2, 7 59 229 47, size
  list 1, 7 9 230 47, size
  box "Results", 5, 1 1 243 110
  button "&Scan", 6, 1 113 24 12
  button "&Close", 7, 208 113 37 12, cancel
  combo 9, 133 113 70 50, size drop
  button "Action", 11, 106 113 24 12
}

alias sc.dlg { dialog -m sc sc }
on *:dialog:sc:init:0: { 
  mdx SetMircVersion $version 
  mdx MarkDialog $dname 
  mdx SetControlMDX $dname 1 ListView report sortascending oneclick grid rowselect showsel nosortheader single > $scriptdirviews.mdx 
  mdx SetControlMDX $dname 2 ListView report sortascending oneclick grid rowselect showsel nosortheader single > $scriptdirviews.mdx 
  ; mdx.dlg headerdims 75:1 500:2 142:3 0:4 | mdx.dlg headertext Name $+ $ch9 $+ Hostmask $+ $ch9 $+ Note
  mdx.dlg clist headerdims 375:1 78:2 | mdx.dlg clist headertext Host $ch9 $chr(35) Clones 
  mdx.dlg dlist headerdims 75:1 100:2 275:3 | mdx.dlg dlist headertext Nick $ch9 Identd $ch9 Common Chans
  dialog -t sc $sc.dlg.title
  didtok sc 9 44 /whois,/query,/invite
  did -c sc 9 1
  sc.fillchans
}
on *:dialog:sc:sclick:*: {
  if ($did == 1) { sc.showInfo *!*@ $+ $gettok($did($dname,$did).seltext,6,32) }
  if ($did == 6) { sc.scan $did(sc,10) }
  if ($did == 11) { sc.action $did(sc,9).seltext }
}
alias -l sc.action {
  if ($sc.clones.seltext !== $null) {
    if ($$1 == /invite) { sc.invite $sc.clones.seltext }
    else {
      $$1 $sc.clones.seltext
    }
  }
}
alias -l sc.comchans {
  var %i = 0
  var %targ = $comchan($$1,0)
  var %str = $null
  while (%i < %targ) {
    inc %i 1
    %str = %str $comchan($$1,%i)
  }
  return $sorttok(%str,32)
}
alias -l sc.showInfo {
  if ($len($$1) > 4) {
    did -r sc 2
    var %targ = $ial($$1,0), %i = 0
    while (%i < %targ) {
      inc %i 1
      mdx.aline rlist $ial($$1,%i).nick $ch9 $ial($$1,%i).user $ch9 $sc.comchans($ial($$1,%i).nick)
    }
  }
}
alias -l sc.fillchans {
  did -r sc 10  
  var %i = 0
  while (%i < $chan(0)) {
    inc %i 1
    did -a sc 10 $chan(%i)
  }
  did -c sc 10 1
  if (%sc.chan !== $null) { sc.selChan %sc.chan }
}
;==============================================================================================================
#sc.who off
raw 315:*: { .disable #sc.who  | halt }
raw 352:*: { .timersc.whoOff 1 30 .disable #sc.who | halt }
#sc.who end
on *:part:#: {  
  if ($nick == $me && $dialog(sc).title !== $null) { set -u3 %sc.chan $did(sc,10).seltext | .timer 1 0 sc.fillchans } 
}
on *:join:#: {
  if ($nick == $me && $dialog(sc).title !== $null) { set -u3 %sc.chan $did(sc,10).seltext | sc.fillchans }
  if ($nick == $me && $chan($chan).ial == $false) { sc.who $chan }
  sc.autoscan $chan $nick $fulladdress
}

alias -l sc.scan {
  if ($$1 == all) { sc.scan.all | return }
  set %sc.ignore $null | did -r sc 1,2
  var %nick = 0, %targ = $nick($$1,0), %curr 
  while (%nick < %targ) {
    inc %nick 1
    %curr = $nick($$1,%nick)
    if ($ialchan($address(%curr,2),$$1,0) > 1) { 
      if ($address(%curr,2) !isin %sc.ignore) {
        set %sc.ignore %sc.ignore $address(%curr,2)
        ;        secho $ialchan($address(%curr,2),$$1,0) - $address(%curr,2)
        mdx.aline clist $gettok($address(%curr,2),2,64) $ch9 $ialchan($address(%curr,2),$$1,0) 
      }
    }
  }
  dialog -t sc $sc.dlg.title Scan on $$1 ( $+ $calc($did(sc,1).lines - 1) clone group(s) found $+ )
  unset %sc.ignore
}
alias -l sc.quickscan {
  if ($$1 ischan && $me ison $$1) {
    if ($dialog(sc).title == $null) { sc.dlg }
    sc.scan $$1 | sc.selChan $$1
  }
}
alias -l sc.selChan {
  var %i = 0, %targ = $did(sc,10).lines
  while (%i < %targ) {
    inc %i 1
    if ($$1 == $did(sc,10,%i)) { did -c sc 10 %i | return }
  }
}
;==============================================================================================================
menu channel {
  Utility
  .&Scan-C
  ..&Open:sc.dlg
  ..&Auto-Alert Config:sc.options
  ..-
  ..&Clone Scan # :sc.quickscan $chan
  ..-
  ..&Readme:sc.hlp
  ..-
  ..&Unload
  ...&Yes I'm sure
  ....&Do it!:unset %sc.options.* | unload -rs $script
}
on *:load: { if ($version < 5.91) { echo 4 -a ERROR: Your mIRC Version, $version $+ , is not compatible with this script. This script requires at least mIRC version 5.91 to operate. Get the latest version at www.mirc.com/get.html | .timer 1 0 .unload -rs $script | halt } | echo 5 -a Scan-S version $sc.version by Shikkie Loaded!! | echo 5 -a Accessor popups are located in the menubar, status, and channel windows. | echo 5 -a Enjoy! | .timer 1 0 sc.hlp.ask }