mIRC Homepage
Posted By: fallen248 dns question - 16/07/03 02:44 PM
I want my bot to report the output of /dns hostname when .dns hostname is posted in the chan...so i used this:on

*:TEXT:.dns *:*:{
/set %botdns $dns($2)
.notice $nick %botdns


but it always comes back as 0 for some reason
Posted By: Collective Re: dns question - 16/07/03 02:49 PM
You can't use $dns like that, you have to do a /dns and then use on DNS to get what it resolved to.
Posted By: fallen248 Re: dns question - 16/07/03 02:52 PM
umm how would i go about doing that?
Posted By: feud Re: dns question - 16/07/03 03:00 PM
collective's right, you can't do what you're attempting with mirc's internal commands. however, i believe there is a dll at ms.org that will retrieve/resolve dns hosts in the manner you're looking for.

edit: raddip.dll
Posted By: codemastr Re: dns question - 16/07/03 03:01 PM
ON *:TEXT:.dns *:*:{
.dns $2
.set %bot_dns_nick $nick
.enable bot_dns
}

#bot_dns off
ON *:DNS:{
.notice %bot_dns_nick $dns(1)
.unset %bot_dns_nick
.disable bot_dns
}
#bot_dns end
Posted By: fallen248 Re: dns question - 16/07/03 04:40 PM
this doesnt work, or at least not how i thought it would...

all i need to happen is when someone types .dns hostname in a chan for the bot to .notice them the ip it resolves to.
Posted By: codemastr Re: dns question - 16/07/03 04:52 PM
Err you're right, this works exactly how you want it to:

ON *:TEXT:.dns *:*:{
.dns $2
.set %bot_dns_nick $nick
.enable #bot_dns
}

#bot_dns off
ON *:DNS:{
if (!$dns(0)) {
.notice %bot_dns_nick Unable to resolve $iif($iaddress,$iaddress,$dns(0).addr)
}
else {
.notice %bot_dns_nick Resolved $dns(1) to $iif($dns(1) == $dns(1).ip,$dns(1).addr,$dns(1).ip)
}
.unset %bot_dns_nick
.disable #bot_dns
halt
}
#bot_dns end
© mIRC Discussion Forums