Dns.info.dawg0100644000076400010010000000375507503465646013724 0ustar AdministratorNoneInformation: This script preforms dns lookup from the channel or the partyline. Changes log for Dns.tcl: Version 2.5 * Released to the public from the |DAWG| Scripting Team web site. * Fixed a tcl error with the dcc command. * Code cleanups. Version 2.4 * Released to the public from the |DAWG| Scripting Team web site. * Major cleanups. * Removed die lines. Version 2.3 * Released to the public from the |DAWG| Scripting Team web site. * Fixed a !nickdns bug. * Cleanups/bug fixes. * Re-worded some things. Version 2.2 * Released to the public from the |DAWG| Scripting Team web site. * Fixed a bad "!dns [die]" bug. :) Version 2.1 * Released to the public from the |DAWG| Scripting Team web site. * Fixed a bad ".dns [die]" bug. * Misc cleanups. * Documentation updates. Version 2.0 * Released to the public from the |DAWG| Scripting Team web site. * Fixed some places where I was using list operations on strings. Version 1.9 * Released to the public from the |DAWG| Scripting Team web site. * Got lost somewhere.... Version 1.8 * Released to the public from the |DAWG| Scripting Team web site. * Minor documentation updates. * Completely removed the DNS: prefix from all channel messages. * Added the option to disable both bold and the DNS: prefix on DCC chat. Version 1.7 * Released to the public from the |DAWG| Scripting Team web site. * Minor documentation updates. Version 1.6 * Released to the public from the |DAWG| Scripting Team web site. * Renamed all putidx commands to putdcc for forward-compatibility reasons. Version 1.5 * Released to the public from the |DAWG| Scripting Team web site. * Added version checking so the script will not attempt to run on anything but eggdrop 1.6.x. Version 1.4 * Released to the public from the |DAWG| Scripting Team web site. * Fixed some control code/formatting bugs. * Made it work in all channels by default. Version 1.3 * UnReleased. * Bug fixes.Dns2.5.tcl0100644000076400010010000001141107503766104013034 0ustar AdministratorNone################################## ### Dns.tcl ### ### Version 2.5 ### ### By Wcc ### ### wcc@techmonkeys.org ### ### http://www.dawgtcl.com:81/ ### ### EFnet #|DAWG|Tcl ### ################################## ############################################################################ ### Copyright © 2000 - 2002 |DAWG| Scripting Group. All rights reserved. ### ############################################################################ ######################################################################## ## This script preforms dns lookup from the channel or the partyline. ## ######################################################################## ############## ## COMMANDS ## ####################################################################### ## DCC ## .dns (Can be changed.) ## ######### Preforms a dns lookup on the specified host or ip address. ## ####################################################################### ## PUB ## !nickdns (Can be changed.) ## ######### Preforms a dns lookup on the specified nick's hostname or ## ######### ip address. ## ######### ---------------------------------------------------------- ## ######### !dns (Can be changed.) ## ######### Preforms a dns lookup on the specified host or ip address. ## ####################################################################### ########################################################## ## Just load the script, edit the settings, and rehash. ## ########################################################## ####################################################### # Set the required flag to use the dns commands here. # ####################################################### set dns_setting(flag) "+o" ############################# # Set the dcc command here. # ############################# set dns_setting(dcc_c) "dns" ################################# # Set the pub dns command here. # ################################# set dns_setting(pub_c) "!dns" ##################################### # Set the pub nickdns command here. # ##################################### set dns_setting(pubn_c) "!nickdns" ################################### # Enable use of bold in DCC chat? # ################################### set dns_setting(bold) 1 ####################################### # Prefix "DNS:" in DCC chat messages? # ####################################### set dns_setting(DNS:) 1 #################### # Code begins here # #################### if {![string match 1.6.* $version]} { putlog "\002DNS:\002 \002WARNING:\002 This script is intended to run on eggdrop 1.6.x or later." } if {[info tclversion] < 8.2} { putlog "\002DNS:\002 \002WARNING:\002 This script is intended to run on Tcl Version 8.2 or later." } bind pub $dns_setting(flag) $dns_setting(pub_c) dns_pub bind pub $dns_setting(flag) $dns_setting(pubn_c) dns_nick_pub bind dcc $dns_setting(flag) $dns_setting(dcc_c) dns_dcc proc dns_dopre {} { if {!$::dns_setting(DNS:)} { return "" } if {!$::dns_setting(bold)} { return "DNS: " } return "\002DNS:\002 " } proc dns_dcc {hand idx text} { if {[scan $text "%s" address] != 1} { putdcc $idx "[dns_dopre]Usage: .dns " ; return } dnslookup [split $address] dns_output_dcc $idx [split $address] } proc dns_pub {nick uhost hand chan text} { if {[scan $text "%s" address] != 1} { putserv "PRIVMSG $chan :Usage: !dns " ; return } dnslookup [split $address] dns_output_pub $chan [split $address] } proc dns_nick_pub {nick uhost hand chan text} { if {[scan $text "%s" rnick] != 1} { putserv "PRIVMSG $chan :Usage: !nickdns " ; return } if {![onchan $rnick $chan]} { putserv "PRIVMSG $chan :$rnick is not on $chan." ; return } set tl [lindex [split [getchanhost $rnick] @] 1] dnslookup $tl dns_output_pub $chan $tl $rnick } proc dns_output_pub {ip host status chan addr {rnick ""}} { if {!$status} { putserv "PRIVMSG $chan :[expr {($rnick != "")?"$rnick's host \($addr\)":"$addr"}] could not be resolved." ; return } set iphost [expr {([string match $ip $addr])?$ip:$host}] putserv "PRIVMSG $chan :[expr {($rnick != "")?"$rnick's host \($iphost\)":"$iphost"}] has been resolved to [expr {([string match $ip $addr])?$host:$ip}]." } proc dns_output_dcc {ip host status idx addr} { if {![valididx $idx]} { return } if {!$status} { putdcc $idx "[dns_dopre]Could not resolve $addr." ; return } putdcc $idx "[dns_dopre][expr {([string match $ip $addr])?$ip:$host}] has been resolved to [expr {([string match $ip $addr])?$host:$ip}]." } putlog "\002DNS:\002 Dns.tcl 2.5 by Wcc is loaded."