;One of the problems with DCC is that mIRC can get the wrong IP address when it starts.
;When *you* initiate a DCC (chat or receive - sending isn't affected by any of this),
;your mIRC sends a CTCP to the other end requesting that *it* call *you* at your IP
;address at the port it says.
;If mIRC got the IP address wrong, you're being called where you aren't, so it won't work.
;This script does a DNS on the nick, getting the real IP address of that nick. If it's not
;the one it was asked to contact, $nick is told to disconnect, reset a few things, reconnect
;and try again. Otherwise he's told that he's set up correctly.
;The other problem is that when the other end contacts you, that request has to be
;routed, by your router, to your computer. The port forwarding in the router has to
;be set up properly. That's addressed in other places.
;I don't remember who first wrote this script, and I'm not going to guess, but
;it was written back in the 1990s, right after Khaled added /dns to mIRC.
;So give me credit for preserving it and adding a few niceties, but
;don't give me credit for writing it.
;Rukbat on DALNet
;If you have other DCC scripts (like rejecting DCC chats from anyone other than an op),
;feel free to contact me in channel (#mirc or #CodeGeekBBS) for help in integrating both
;of them. It's easy.
;Enable it with the menu (it's in Commands on the menubar, or change the popup
;to another place if you like). It will run once (when the next person attempts
;a chat) and disable itself.
;Tell the person asking for help with DCC receive or chat to DCC chat you.
;He'll get a response from the script. You'll see in your status window what
;he sees in notice.
;Note: You should NEVER run this script in a channel you're not opped in. It's considered
;bad manners to do something like this in someone else's channel without permission.
#dnschk off
on @+1:dns:{
if $nick == %dnschk {
if ($len($comchan(%dnschk,0)) < 1 ) {
close -c $nick
notice $nick Sorry, I don't accept DCC chats from outside the channel.
halt
}
close -c $nick
notice $nick $+ , you can close the chat window now.
if ( $raddress != $null ) {
if (%dnsaddy == $raddress ) {
notice $nick $+ , your ip is correct - if you're trying to fix a DCC problem, you shouldn't have any problem now.
notice $nick If you're trying to talk to me, please ask your mIRC-related question in the channel.
notice $comchan(%dnschk,1) $nick has been told that his ip is correct
}
else {
notice $nick $+ , you have %dnsaddy in File-Options-Local Info-IP Address, but a /dns reports you to be at $raddress $+ . Disconnect (type 3/quit, type 3/localinfo -u, thencome back here and type 3/dcc chat $me again.
notice $comchan(%dnschk,1) $nick has been sent DCC setup info
}
}
else {
notice $nick Sorry, $nick $+ , but I am unable to resolve your address.
notice $nick For DCC Send problems, or if you have problems connecting to an IRC server, go to Options-Connect-Local - Local Host and IP Address should BOTH be checked
notice $nick (check Local host - IP Address will be checked and greyed-out). The dot should be at Server, not Normal.
notice $nick Do this when you're not connected to a server. Then reconnect and come back here.
}
unset %dnschk %dnsaddy
}
.disable #dnschk
.disable #dccchk
echo DCC Check disabled
}
#dnschk end
#dccchk off
ctcp 1:dcc chat:{
%dnsaddy = $longip($4)
set %dnschk $nick
.enable #dnschk
.dns $nick
.halt
}
#dccchk end
menu menubar {
Server
DCC Check
.Enable: {
.enable #dccchk
echo DCC Check enabled
}
.Disable: {
.disable #dccchk
echo DCC Check disabled
}
}
;When *you* initiate a DCC (chat or receive - sending isn't affected by any of this),
;your mIRC sends a CTCP to the other end requesting that *it* call *you* at your IP
;address at the port it says.
;If mIRC got the IP address wrong, you're being called where you aren't, so it won't work.
;This script does a DNS on the nick, getting the real IP address of that nick. If it's not
;the one it was asked to contact, $nick is told to disconnect, reset a few things, reconnect
;and try again. Otherwise he's told that he's set up correctly.
;The other problem is that when the other end contacts you, that request has to be
;routed, by your router, to your computer. The port forwarding in the router has to
;be set up properly. That's addressed in other places.
;I don't remember who first wrote this script, and I'm not going to guess, but
;it was written back in the 1990s, right after Khaled added /dns to mIRC.
;So give me credit for preserving it and adding a few niceties, but
;don't give me credit for writing it.
;Rukbat on DALNet
;If you have other DCC scripts (like rejecting DCC chats from anyone other than an op),
;feel free to contact me in channel (#mirc or #CodeGeekBBS) for help in integrating both
;of them. It's easy.
;Enable it with the menu (it's in Commands on the menubar, or change the popup
;to another place if you like). It will run once (when the next person attempts
;a chat) and disable itself.
;Tell the person asking for help with DCC receive or chat to DCC chat you.
;He'll get a response from the script. You'll see in your status window what
;he sees in notice.
;Note: You should NEVER run this script in a channel you're not opped in. It's considered
;bad manners to do something like this in someone else's channel without permission.
#dnschk off
on @+1:dns:{
if $nick == %dnschk {
if ($len($comchan(%dnschk,0)) < 1 ) {
close -c $nick
notice $nick Sorry, I don't accept DCC chats from outside the channel.
halt
}
close -c $nick
notice $nick $+ , you can close the chat window now.
if ( $raddress != $null ) {
if (%dnsaddy == $raddress ) {
notice $nick $+ , your ip is correct - if you're trying to fix a DCC problem, you shouldn't have any problem now.
notice $nick If you're trying to talk to me, please ask your mIRC-related question in the channel.
notice $comchan(%dnschk,1) $nick has been told that his ip is correct
}
else {
notice $nick $+ , you have %dnsaddy in File-Options-Local Info-IP Address, but a /dns reports you to be at $raddress $+ . Disconnect (type 3/quit, type 3/localinfo -u, thencome back here and type 3/dcc chat $me again.
notice $comchan(%dnschk,1) $nick has been sent DCC setup info
}
}
else {
notice $nick Sorry, $nick $+ , but I am unable to resolve your address.
notice $nick For DCC Send problems, or if you have problems connecting to an IRC server, go to Options-Connect-Local - Local Host and IP Address should BOTH be checked
notice $nick (check Local host - IP Address will be checked and greyed-out). The dot should be at Server, not Normal.
notice $nick Do this when you're not connected to a server. Then reconnect and come back here.
}
unset %dnschk %dnsaddy
}
.disable #dnschk
.disable #dccchk
echo DCC Check disabled
}
#dnschk end
#dccchk off
ctcp 1:dcc chat:{
%dnsaddy = $longip($4)
set %dnschk $nick
.enable #dnschk
.dns $nick
.halt
}
#dccchk end
menu menubar {
Server
DCC Check
.Enable: {
.enable #dccchk
echo DCC Check enabled
}
.Disable: {
.disable #dccchk
echo DCC Check disabled
}
}