mIRC Homepage

$host2ip and $ip2host

Posted By: Spola

$host2ip and $ip2host - 09/03/03 12:46 PM

There was a dll to do this, but it would be nice if it was hardcoded into mIRC.

We can use /dns to do this, but then you have to break up your script in multiple aliases.
Posted By: Watchdog

Re: $host2ip and $ip2host - 09/03/03 04:37 PM

*Watchdog is lost...

And what is wrong with /dns? It gives you exactly what is required of an NS lookup.
Posted By: Sabby

Re: $host2ip and $ip2host - 09/03/03 06:27 PM

/dns echo's the result,
he is talking about an identifer to return it.
Posted By: Collective

Re: $host2ip and $ip2host - 09/03/03 06:50 PM

Quote:
/dns echo's the result,
he is talking about an identifer to return it.


In on DNS there is the $dns identifier to get the result..

Personally I like the idea - while it's not a necessity, it would save a bit of time scripting.
Posted By: Sabby

Re: $host2ip and $ip2host - 09/03/03 07:19 PM

i tried it, it didnt work..

//var %x = $dns($me) | echo -a %x

just echo'ed 0
Posted By: Collective

Re: $host2ip and $ip2host - 09/03/03 07:20 PM

I said in on DNS, type /help on DNS and you will see what I mean.
Posted By: Doqnach

Re: $host2ip and $ip2host - 11/03/03 09:20 PM

only weird thing is with the loop I made for it, it sometimes won't stop spitting out info :-]

Code:
alias dns { .dns $1- | echo 10 $iif($cid != $activecid,-sti3,-ati3)  (DNS) Looking up: " $+ $1- $+ " | set %doqhaltdef.dns $1- }
on *:DNS: {
  if (!$dns(0)) { echo 10 $iif($cid != $activecid,-sti3,-ati3)  (DNS) <Error> Unable to resolve: $+(",%doqhaltdef.dns,") }
  else { var %i = 1 | while (($dns(%i)) && (%i < 99)) { if ($replace($raddress,.,$null) !isnum) { echo 10 $iif($cid != $activecid,-sti3,-ati3)  (DNS) $+(<,$iif($dns(%i).nick,$ifmatch,None),>) $dns(%i).ip  $dns(%i).addr } | else { echo 10 $iif($cid != $activecid,-sti3,-ati3)  (DNS) $+(<,$iif($dns(%i).nick,$ifmatch,None),>) $dns(%i).addr  $dns(%i).ip } | inc %i } }
  unset %doqhaltdef.dns
  haltdef
}


I put in the %i < 99 to counter an infinite loop which sometimes occurs
Posted By: Sabby

Re: $host2ip and $ip2host - 12/03/03 01:10 AM

o, didnt ketch the on DNS part.. thought you ment on just a regular basis.
© 2021 mIRC Discussion Forums