mIRC Homepage
Posted By: Rich $dns(0) - 21/08/03 12:53 PM
From the help file: (last line of on DNS)
You can use $dns(0).nick/addr/ip to reference properties if an address couldn't be resolved.

Now I put this in my first loaded remote script:
on *:DNS:echo -s $dns(0) * $dns(0).ip * $dns(0).addr * $dns(0).nick * | halt

And I typed this in my status window:
/!dns 0.0.0.1

It echoed this:
[14:46:58] * Looking up 0.0.0.1
0 * * * *


Instead of this:
[14:46:58] * Looking up 0.0.0.1
0 * 0.0.0.1] * * *


If I turn my remotes of it echoes this:
[14:51:35] * Looking up 0.0.0.1
[14:51:40] * Unable to resolve 0.0.0.1


I think this is a bug, since $dns(0).ip should return 0.0.0.1
Posted By: codemastr Re: $dns(0) - 21/08/03 03:09 PM
Yeah $dns(0) doesn't work well, what I use in my script is:

Code:
if ($dns(0) == 0) {
  if ($dns(0).nick && !$iaddress && !$dns(0).addr) {
    .echo $color(info) -ts * /dns: no such user $dns(0).nick
    halt
  }
  echo $color(other) -ts * Unable to resolve $iif($iaddress,$iaddress,$dns(0).addr)
}


That seems to work perfectly.
Posted By: Rich Re: $dns(0) - 23/08/03 01:22 PM
Thanks, $iaddress is removed from the help file so I didn't think about it.
© mIRC Discussion Forums