mIRC Homepage
Posted By: alkahol1k how to get all server ips? - 13/09/04 10:47 PM
Any way by scripting you could get the ip of every server connected to a network ?
Posted By: tidy_trax Re: how to get all server ips? - 13/09/04 11:02 PM
You could do this:

Code:
alias serverips {
  if ($status == connected) {
    inc -u30 %serverips
    links
  }
}
raw 364:*:{
  if (%serverips) {
    .dns $2
    halt
  }
}
raw 365:*:{
  if (%serverips) { halt }
}
on *:dns:{
  if (%serverips) {
    var %i = 1
    while ($dns(%i)) {
      echo -a $dns(%i).ip
      inc %i
    }
  }
}


But that will queue all but the current dns being looked up, so it may take a while.

Usage: /serverips
Posted By: Armada Re: how to get all server ips? - 14/09/04 06:09 AM
Good idea but most networks Ive been on dont have dnsable servers like that they use a round robin so in that case
Code:
 ON *:DNS:{
  if ($dns(0) == 0) {
    echo $color(other) -ta * Unable to resolve $iif($iaddress,$iaddress,$dns(0).addr)
  }
  else {
    var %numhosts $dns(0), %host = 0
    var %hosts
    while (%host < %numhosts) {
      inc %host 1
      set %hosts %hosts $iif($dns(1) == $dns(1).ip,$dns(%host).addr,$dns(%host).ip) $+ $chr(32) $+ $chr(45)
    }
    echo $color(other) -ta * Resolved $dns(1) to $left(%hosts,$calc($len(%hosts)-1))
  }
  halt
} 

and say its irc.mirc.com you connect to
/dns irc.mirc.com
© mIRC Discussion Forums