Dns2.4.tcl0100600000076400007640000001011107437557206010656 0ustar wccwcc############################ ### Dns.tcl ### ### Version 2.4 ### ### By Wcc ### ### wcc@techmonkeys.org ### ### http://dawg.dynu.com ### ### EFnet #|DAWG|Tcl ### ############################ ############################################################################ ### Copyright © 2000 - 2001 |DAWG| Scripting Group. All rights reserved. ### ############################################################################ ######################################################################## ## This script preforms dns lookup from the channel or the partyline. ## ######################################################################## ############## ## COMMANDS ## ########################################## ## DCC ## .dns ## ######### Preforms a dns lookup on the ## ######### specified host or ip address. ## ########################################## ## PUB ## !nickdns ## ######### Preforms a dns lookup on the ## ######### specified nick's hostname or ## ######### ip address. ## ######### ----------------------------- ## ######### !dns ## ######### 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. # ################################################### set dns_setting(flag) "+o" ################################### # 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 dns_pub bind pub $dns_setting(flag) !nickdns dns_nick_pub bind dcc $dns_setting(flag) dns dns_dcc proc dns_dopre {} { global dns_setting 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 } putserv "PRIVMSG $chan :[expr {([string match $ip $addr])?$ip:$host}] has been resolved to [expr {([string match $ip $addr])?$host:$ip}]." } putlog "\002DNS:\002 Dns.tcl 2.4 by Wcc is loaded."Dns.info.dawg0100600000076400007640000000353207431655040011522 0ustar wccwccInformation: This script preforms dns lookup from the channel or the partyline. Changes log for Dns.tcl: 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.