mIRC Home    About    Download    Register    News    Help

Print Thread
#36709 16/07/03 02:44 PM
Joined: Feb 2003
Posts: 20
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
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

#36710 16/07/03 02:49 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can't use $dns like that, you have to do a /dns and then use on DNS to get what it resolved to.

#36711 16/07/03 02:52 PM
Joined: Feb 2003
Posts: 20
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
umm how would i go about doing that?

#36712 16/07/03 03:00 PM
Joined: Dec 2002
Posts: 127
F
Vogon poet
Offline
Vogon poet
F
Joined: Dec 2002
Posts: 127
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

Last edited by feud; 16/07/03 03:02 PM.

------
deep down, i'm really superficial.
#36713 16/07/03 03:01 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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

#36714 16/07/03 04:40 PM
Joined: Feb 2003
Posts: 20
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2003
Posts: 20
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.

#36715 16/07/03 04:52 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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


Link Copied to Clipboard