mIRC Home    About    Download    Register    News    Help

Print Thread
#97574 13/09/04 10:47 PM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
Any way by scripting you could get the ip of every server connected to a network ?

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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


New username: hixxy
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
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


Link Copied to Clipboard