This script simply allows you to WHOIS a domain via "@whois domain.name" in a channel, the whois results are then queried to the user who typed the command.
Current Features:
Requirements:
Setup:
Follow the requirements (above) and simply load the script and its ready to go!
CAUTION! - This script is VERY spammy due to WHOIS Server TOS' this cannot be directly helped and could encourage users to spam you or the IRCD to disconnect you.
Known Bugs:
Credit:
The TLD list was obtained from http://www.nirsoft.net/whois_servers_list.html
The WHOIS Server explanation can be found here: http://www.anta.net/misc/telnet-troubleshooting/whois.shtml
Leave your comments below!
; Domain whois script. For bots.
; Script by Thomas Edwards (2012)
; Feel free to use this snippet anywhere and to modify it yourself
; Please leave any credit for the orignal code if you use any of it.
on 1:TEXT:@whois*:#:{
if ($2 == $null) {
msg # Syntax: @whois domain.name
}
else {
set %domain $2
set %tld $right($2,$calc(0 - $pos($2,.,$count($2,.))))
set %dest $nick
set %channel
sockopen whois $+ $rand(1,99) $readini(whois.ini,tld,%tld) 43
msg # WHOIS Lookup on: $2 - TLD: %tld - WHOIS Server: $readini(whois.ini,tld,%tld) - The WHOIS WILL be pm'd to $nick
}
}
on 1:sockopen:whois*:{
sockwrite $sockname %domain $+ $crlf
}
on 1:sockread:whois*:{
var %read
sockread %read
tokenize 32 %read
if ($1 == Whois && $2 == Server:) {
msg %dest 4[WHOIS] WHOIS Redirect. Redirecting to $3-
whois_redir $3 %domain %dest
sockclose $sockname
halt
}
else {
msg %dest 3[WHOIS] %read
}
}
on 1:sockclose:whois*:{
msg %dest 4[WHOIS] WHOIS END. Script by Thomas Edwards.
unset %domain %dest %channel %tld
}
alias whois_redir {
; $1 = whois Server
; $2 = Domain Name
set %domain $2
set %dest $3
sockopen whois $+ $rand(0,99) $1 43
}