Scan host

By Corne on May 14, 2005

This snippet allows you to scan certains host from a channel and it shows the results in a separated window. Just try it...

ON me:*:join:#:{
  if ($chan(#).ial == $true) { halt }
  if ($chan(#).ial == $false) {
    .timer 1 2 .who #
    .enable #shost
  }
}
#shost off
raw 352:*: halt
raw 315:*:{
  haltdef
  .disable #shost 
}
#shost end

menu channel {
  -
  Scan
  .-
  .Mask:{
    set %shost $?="Mask to scan for ?"
    if ($ialchan(%shost,#,0) == 0) { echo $color(info) -at Mask %shost is not on this channel. }
    if ($ialchan(%shost,#,0) == 1) {
      clear @SHost
      window -ble @SHost 
      aline @SHost Scanning for mask $! $+ ... 
      aline @Shost $str(-,30) 
      aline @SHost $str( ,1) $+ Nickname $str( ,15) Ident $str( ,15) Hostname
      aline @SHost $str( ,30)
      aline @SHost $str( ,1) $ialchan(%shost,#,1).nick $str( ,$calc(22 - $len($ialchan(%shost,#,1).nick))) $ialchan(%shost,#,1).user $str( ,$calc(42 - 22 - $len($ialchan(%shost,#,1).user))) $ialchan(%shost,#,1).host 
      window -ble @SHost 
    }
    if ($ialchan(%shost,#,0) > 1) {
      var %host = 1
      var %hostn = $ialchan(%shost,#,0)
      clear @SHost
      window -ble @SHost 
      aline @SHost Scanning for mask $! $+ ... 
      aline @SHost $ialchan(%shost,#,0) matches
      aline @Shost $str(-,30) 
      aline @SHost $str( ,1) $+ Nickname $str( ,15) Ident $str( ,15) Hostname
      aline @SHost $str( ,30)
      while %host <= %hostn {
        aline @SHost $str( ,1) $ialchan(%shost,#,%host).nick $str( ,$calc(22 - $len($ialchan(%shost,#,%host).nick))) $ialchan(%shost,#,%host).user $str( ,$calc(42 - 22 - $len($ialchan(%shost,#,%host).user))) $ialchan(%shost,#,%host).host 
        inc %host
      }
      window -ble @SHost 
    }
  }
  .$iif((%shost != $null), %shost):{ 
    if ($ialchan(%shost,#,0) == 0) { echo $color(info) -at Mask %shost is not on this channel. }
    if ($ialchan(%shost,#,0) == 1) {
      clear @SHost
      window -ble @SHost 
      aline @SHost Scanning for mask %shost $+ ... 
      aline @SHost $ialchan(%shost,#,0) matches
      aline @Shost $str(-,30) 
      aline @SHost $str( ,1) $+ Nickname $str( ,15) Ident $str( ,15) Hostname
      aline @SHost $str( ,30)
      ;      aline @SHost $str( ,1) $ialchan(%shost,#,1).nick $str( ,$calc(22 - $len($ialchan(%shost,#,1).nick))) $ialchan(%shost,#,1).user $str( ,$calc(15 - $ialchan(%shost,#,1).user))) $ialchan(%shost,#,1).host 
      aline @SHost $str( ,1) $ialchan(%shost,#,1).nick $str( ,$calc(22 - $len($ialchan(%shost,#,1).nick))) $ialchan(%shost,#,1).user $str( ,$calc(42 - 22 - $len($ialchan(%shost,#,1).user))) $ialchan(%shost,#,1).host 

      window -ble @SHost 
    }
    if ($ialchan(%shost,#,0) > 1) {
      var %host = 1
      var %hostn = $ialchan(%shost,#,0)
      clear @SHost
      window -ble @SHost 
      aline @SHost Scanning for mask %shost $+ ... 
      aline @SHost $ialchan(%shost,#,0) matches
      aline @Shost $str(-,30) 
      aline @SHost $str( ,1) $+ Nickname $str( ,15) Ident $str( ,15) Hostname
      aline @SHost $str( ,30)
      while %host <= %hostn {
        aline @SHost $str( ,1) $ialchan(%shost,#,%host).nick $str( ,$calc(22 - $len($ialchan(%shost,#,%host).nick))) $ialchan(%shost,#,%host).user $str( ,$calc(42 - 22 - $len($ialchan(%shost,#,%host).user))) $ialchan(%shost,#,%host).host 
        inc %host
      }
      window -ble @SHost 
    }
  }
}

Comments

Sign in to comment.
Priamos   -  Sep 28, 2006

Well, the new window appears and I can see the number of the found hosts, but not the nicknames/identd etc.. I got this mistake \'* /aline: insufficient parameters\' , probably from the last lines of the code. Any ideas please ?

 Respond  
Corne   -  May 16, 2005

And you are also able to see/scan the last scan you made so if you want to scan again the same host you scanned last time you don\'t have to type it again, you will see it below \'Mask\'

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.