Network scanner for user

Network scanner for user

mIRC Snippet that allows you to search for a specific user on another network using scid identifier.

Postat de Copyright Categorie Review user Vizualizari Data
BLKoldSUN Westor stats Cod testat 556 2024-08-03 17:47:47

;;;INFO
;;;/scanchan = This will scan the channel and will give information if anyone on the channel is online on any other network and channel that you are on.
;;;
;;;/scanick = This will scan the nickname if is online on any other network channel that you are on.
 
Menu nicklist  {
  $iif(%advmode == on,Scan $1 For Clones):scanick $1
  -
}
 
menu channel  {
  $iif(%advmode == on,Scan $chan For Clones):scanchan $chan
  -
}
 
ON *:JOIN:#: {
  if ($nick == $me) { .timer[SCAN_CHAN_ $+ $chan $+ ] 1 1 scanchan $chan }
  elseif ($nick !== $me) { .timer[SCAN_NICK_ $+ $nick $+ ] 1 3 scanick $nick }
}
 
alias scanchan {
  if (!$1) { linesep -a | echo -ac i [Network Scanner]: Error, Not enough parameters, enter the channel! | linesep -a | return }
  if ($status !== connected) { linesep -a | echo -ac i [Network Scanner]: Error, You are NOT connected to the server! | linesep -a | return }
  if ($me !ison $1) { linesep -a | echo -ac i [Network Scanner]: Error, You are NOT on the $1 channel! | linesep -a | return }
  if (!$ial) { echo $1 [Network Scanner]: Error, The IAL is NOT enabled, use /ial on and retry! | return }
  if ($scon(0) == 1) { echo $1 [Network Scanner]: Error, You are NOT on any other network connected! | return }
  if (!$nick($1,0)) { echo $1 [Network Scanner]: Error, There are NOT any users on the $1 channel! | return }
  if ($nick($1,0) == 1) { echo $1 [Network Scanner]: Error, There must be more than 1 user(s) on the $1 channel to scan! | return }
  if (!$address($me,2)) { echo $1 [Network Scanner]: Error, Your IAL lis is not updated, please use: /scon -a who * to update it and retry! | return }
  echo $1 [Network Scanner]: Scanning now on all the network(s) and all the channel(s) for same host on $1 channel, Please wait...
  var %myaddr = $address($me,2)
  var %mycid = $cid
  var %t = $nick($1,0)
  var %i = 1
  while (%i <= %t) {
    var %n = $nick($1,%i)
    var %h = $mask($ialchan(%n,$1,1),2)
    if (%h) && (%h !== %myaddr) { hadd -m SCANCLONE_HOSTS %h 1 }
    hadd -m SCANCLONE_NICKS %h %n
    inc %i
  }
  if ($hget(SCANCLONE_HOSTS,0).data) {
    var %tt = $scon(0)
    var %ii = 1
    while (%ii <= %tt) {
      var %net = $scon(%ii).network
      if (!$istok(%nets,%net,32)) && ($network !== %net) {
        var %cid = $scon(%ii).cid
        var %nets = $addtok(%nets,%net,32)
        var %chans = $scon(%ii).allchans
        var %iii = 1
        while (%iii <= $numtok(%chans,44)) {
          var %cc = $gettok(%chans,%iii,44)
          var %tot = $tot_nick(%cid,%cc)
          if (!%tot) || (%tot == 1) { goto next }
          var %iiii = 1
          while (%iiii <= %tot) {
            var %mn = $gt_me_nick(%cid)
            var %mh = $gt_me_host(%cid)
            var %nn = $gt_nick(%cid,%cc,%iiii)
            var %hh = $gt_host(%cid,%nn,%cc)
            if ($hget(SCANCLONE_NICKS,%hh)) { var %fn = $hget(SCANCLONE_NICKS,%hh) }
            if ($hget(SCANCLONE_HOSTS,%hh)) && (%nn !== %mn) && (%hh !== %myaddr) && (%hh !== %mh) {
              echo $1 [Network Scanner]: [ $+ $iif(%fn,$v1,N/A) $+ ] -> The  $+ %nn $+  ( $+ $iif(%hh,$v1,N/A) $+ ) is online on  $+ %net $+  network on  $+ %cc $+  channel! 
              var %total = $calc(%total +1)
            }
            inc %iiii
          }
          :next
          inc %iii
        }
      }
      inc %ii
    }
  }
  echo $1 [Network Scanner]: End of the Network Scanner Scan. - (Total:  $+ $iif(%total,$v1,0) $+ )
  if ($hget(SCANCLONE_HOSTS)) { hfree SCANCLONE_HOSTS }
  if ($hget(SCANCLONE_NICKS)) { hfree SCANCLONE_NICKS }
}
 
alias scanick {
  if (!$ial) { linesep -a | echo -ac i [Network Scanner]: Error, The IAL is NOT enabled, use /ial on! | linesep -a | return }
  if (!$1) { linesep -a | echo -ac i [Network Scanner]: Error, Not enough parameters, enter the channel! | linesep -a | return }
  if ($status !== connected) { linesep -a | echo -ac i [Network Scanner]: Error, You are NOT connected to the server! | linesep -a | return }
  if ($scon(0) == 1) { linesep -a | echo -ac i [Network Scanner]: Error, You are NOT on any other network connected! | linesep -a | return }
  if (!$address($me,2)) { linesep -a | echo -ac i [Network Scanner]: Error, Your IAL lis is not updated, please use: /scon -a who * to update it and retry! | linesep -a | return }
  var %myaddr = $address($me,2)
  var %host_temp = $mask($ial($1,1),2)
  if (%host_temp) {
    var %tt = $scon(0)
    var %ii = 1
    while (%ii <= %tt) {
      var %net = $scon(%ii).network
      if (!$istok(%nets,%net,32)) && ($network !== %net) {
        var %cid = $scon(%ii).cid
        var %nets = $addtok(%nets,%net,32)
        var %chans = $scon(%ii).allchans
        var %iii = 1
        while (%iii <= $numtok(%chans,44)) {
          var %cc = $gettok(%chans,%iii,44)
          var %tot = $tot_nick(%cid,%cc)
          if (!%tot) || (%tot == 1) { goto next }
          var %iiii = 1
          while (%iiii <= %tot) {
            var %mn = $gt_me_nick(%cid)
            var %mh = $gt_me_host(%cid)
            var %nn = $gt_nick(%cid,%cc,%iiii)
            var %hh = $gt_host(%cid,%nn,%cc)
            if ($istok(%host_temp,%hh,32)) && (%nn !== %mn) && (%hh !== %mh) && (%hh !== %myaddr) { echo -a [Network Scanner]: The  $+ %nn $+  ( $+ $iif(%hh,$v1,N/A) $+ ) is online on  $+ %net $+  network on  $+ %cc $+  channel! }
            inc %iiii
          }
          :next
          inc %iii
        }
      }
      inc %ii
    }
  }
}
 
alias -l allchans {
  var %t = $chan(0)
  var %i = 1
  while (%i <= %t) {
    var %c = $chan(%i)
    if ($me ison %c) { var %tot = $addtok(%tot,%c,44) }
    inc %i
  }
  return $iif(%tot,$v1,0)
}
 
alias -l tot_nick {
  if (!$1) { return 0 }
  scid $1
  return $nick($2,0)
}
alias -l gt_nick {
  if (!$1) { return N/A }
  scid $1
  return $nick($2,$3)
}
alias -l gt_host {
  if (!$1) { return N/A }
  scid $1
  return $iif($mask($ialchan($2,$3,1),2),$v1,N/A)
}
alias -l gt_me_host {
  if (!$1) { return N/A }
  scid $1
  return $iif($address($me,2),$v1,N/A)
}
alias -l gt_me_nick {
  if (!$1) { return N/A }
  scid $1
  return $me
}