mIRC Homepage
Posted By: PhantasyX No Resolve on DNS - 19/10/05 11:56 PM
Alright, I was wondering though I'm not for sure how.
When something, and there is no resolved address.. I would like it to echo the address that wasn't resolved, I tryed the several $DNS().nick/addr/ip (even without the props). But I still can't get it to echo the addr even if it wasn't resolved.

So for example here is just my code (just used mIRC's)

Code:
on *:DNS:{
  var %n = $dns(0)
  echo -a $timestamp $sides(/DNS:,6) Found %n addresses for [[ $+ $iif(!$dns(1).addr,$dns(1),$dns(1).addr) $+ ]]
  while (%n > 0) {
    echo -a $timestamp $sides(/DNS:,6) IP: $dns(%n).ip $iif($dns(%n).nick,NICK: $dns(%n).nick)
    dec %n
  }
}


Say I DNS'd something, it would return either:
Found N addresses for [ some.addr.com/ip ]

Say if it didn't resolve:
Found 0 addresses for [ ].

How can I get it to say
Found 0 addresses for [ the.adddr.or.ip.i.was.trying.to.resolve./ip ]

In mIRC help it says: "You can use $dns(0).nick/addr/ip to reference properties if an address couldn't be resolved."

I'm not for sure, but I even tryed all those and still returns $null.

Anyone got any ideas? Maybe make a new suggestion if this isn't possible for mIRC to return the address trying to be resolve if it couldn't be resolved? :|
Posted By: Rand Re: No Resolve on DNS - 20/10/05 03:06 AM
If you are DNS'ing an IP, that returns 0 matches, you can use:
$dns(0).ip

If you are DNS'ing a Hostmask, that returns 0 matches, you can use:
$dns(0).addr


Edit:
Example:

Code:
on *:DNS:{
  var %n = $dns(0)
  if (%n == 0) { echo -a $timestamp Found %n addresses. [[ Address: $iif($dns(0).addr,$v1,Not Found) $+ , IP: $iif($dns(0).ip,$v1,Not Found) ]] }
  else { echo -a $timestamp $sides(/DNS:,6) Found %n addresses for [[ $+ $iif(!$dns(1).addr,$dns(1),$dns(1).addr) $+ ]] }
  while (%n > 0) {
    echo -a $timestamp $sides(/DNS:,6) IP: $dns(%n).ip $iif($dns(%n).nick,NICK: $dns(%n).nick)
    dec %n
  }
}
Posted By: PhantasyX Re: No Resolve on DNS - 20/10/05 10:41 PM
Yay ;x
© mIRC Discussion Forums