mIRC Homepage
Posted By: Doqnach added 'on DNS' feature - 22/01/03 12:37 PM
it's really anyoing... I doing a mIRC theme...

and with on *:DNS: when it fails to resolve, mIRC returns an error including the dns/ip/nick you wanted to resolve...

now, there is no way to use that value yourself. I would like to see on *:DNS: return the error as $1- in a next mIRC version... it would save some scripting work and I would think it's logical to do so
Posted By: Watchdog Re: added 'on DNS' feature - 22/01/03 12:45 PM
Right here mate.

It's not what you are after because it's a script but it does hide the original theme.

to hide the INPUT just make this alias:

dns .dns $1
Posted By: Doqnach Re: added 'on DNS' feature - 22/01/03 01:45 PM
like I said in the precious post, I know the work around :-] and it's working... but it's crap to have to write an alias, save a var and then read it with on dns... cause mIRC saves the info too so why do stuff twice if you don't have too

since mIRC saves it why not make it accessible to the on DNS event?
Posted By: Watchdog Re: added 'on DNS' feature - 22/01/03 02:13 PM
I see what you mean now - what do you intend to do with $1 if it doesn't resolve? The reason I ask is that $address returns whatever you type in ($1). I just haven't included that in the script I submitted because it is an old one I wrote before I knew as much as I know now.

Note: If you do the DNS lookup on a nickname $address returns the host the nick is connected with and $null if the nickname is not on IRC.
Posted By: Doqnach Re: added 'on DNS' feature - 22/01/03 02:22 PM
well, what I mean is:

when the dns resolved $dns is filled with all info needed, $1- might be $true
when it failes $dns == $null and $1- is the dns you wanted to resolve ( /dns (nick/ip/address) ) so you don't have to create an alias /dns { dns $1- | set %dns $1- } which you can read when dns failes: if (!$dns(0)) { echo -a can't resolve: %dns }

get it ?

you could just do: if (!$dns(0)) { echo -a can't resolve: $1- }
© mIRC Discussion Forums