Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Domain WHOIS Script - v1 - [BOTS]

Recommended Posts

  • Administrators
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:

- Supports redirects to other WHOIS Servers.

 

Requirements:

- Create the file 'whois.ini' and paste the contents of http://pastebin.com/raw.php?i=3TaDZ46n into it.

 

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:

- Can only whois one domain at a time you must wait till the domain has been whois'd before requesting another whois due to the laziness of variables.

- Some whois servers have to be queried differently to get the correct results so you could end up with completely different results than what you expected.

- If a domain does not exist nothing happens and the socket will most likely time out.

 

Credit:

The TLD list was obtained from http://www.nirsoft.n...rvers_list.html

The WHOIS Server explanation can be found here: http://www.anta.net/...ing/whois.shtml

 

 

 

 

 

 

; 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

}

Link to comment
Share on other sites



×
×
  • Create New...