Ip Check for Eggdrop

Platform:  TCL
Published  Jun 20, 2011
Updated  Feb 11, 2012
This script grabs some ip information from www.melissadata.com and returns it to irc.
Default trigger is: !ipinfo
Syntax: !ipinfo 1.2.3.4
Chanset: +ipinfo
ScreenShot: ##############################################################################################
## ## Ipinfo.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help ## ##
##############################################################################################
## To use this script you must set channel flag +ipinfo (ie .chanset #chan +ipinfo) ##
##############################################################################################
##############################################################################################
## ## Start Setup. ## ##
##############################################################################################
## Change the character between the "" below to change the command character/trigger. ##
set Ipinfocmdchar "!"
proc Ipinfo {nick host hand chan search} {
if {[lsearch -exact [channel info $chan] +ipinfo] != -1} {
## Change the format codes between the "" below to change the color/state of the text. ##
set titlef "\0034"
set textf "\003\002"
##############################################################################################
## ## End Setup. ## ##
##############################################################################################
set Ipinfosite "www.melissadata.com"
if {$search == ""} {
putserv "PRIVMSG $chan :${textf}You must provide an ip address to check!"
} else {
set Ipinfourl "/lookups/iplocation.asp?ipaddress=${search}"
if {[catch {set Ipinfosock [socket -async $Ipinfosite 80]} sockerr]} {
putlog "$Ipinfosite $Ipinfourl $sockerr error"
return 0
} else {
puts $Ipinfosock "GET $Ipinfourl HTTP/1.0"
puts $Ipinfosock "Host: $Ipinfosite"
puts $Ipinfosock "User-Agent: Opera 9.6"
puts $Ipinfosock ""
flush $Ipinfosock
while {![eof $Ipinfosock]} {
set Ipinfovar " [gets $Ipinfosock] "
if {[regexp {<div align='center' class='Lookupserror'>([^<]*)<b>([^<]*)<\/b>([^<]*)<br>([^<]*)<\/div>} $Ipinfovar]} {
putserv "PRIVMSG $chan : ${titlef}Syntax error: ${textf}Ip must be in the form of 1.2.3.4"
close $Ipinfosock
return 0
} elseif {[regexp {<td class='columresult'>([^<]*)<\/td><td align='left'><b>([^<]*)<\/b><\/td><\/tr>} $Ipinfovar]} {
set IPResult [regexp -all -inline {<td class='columresult'>([^<]*)<\/td><td align='left'><b>([^<]*)<\/b><\/td><\/tr>} $Ipinfovar]
set IPResults "${titlef}[lindex $IPResult {1}]: ${textf}[lindex $IPResult {2}] [lindex $IPResult {3}]"
putserv "PRIVMSG $chan : [ipinforecode $IPResults]"
}
}
close $Ipinfosock
return 0
}
}
}
}
proc ipinforecode { textin } {
return [string map {&quot; \" &middot; "" &amp; & &nbsp; ""} [subst [regsub -nocase -all {&#([0-9]{1,5});} $textin {\u\1}]]]
}
bind pub - ${Ipinfocmdchar}ipinfo Ipinfo
setudef flag ipinfo
putlog "Ipinfo Script by Ford_Lawnmower successfully loaded! irc.geekshed.net #Script-Help"

Comments

Sign in to comment.
RIcko   -  Jun 29, 2012
Looks like we have a fan, but still .. he have no right to use it
 Respond  
Jethro   -  Jun 29, 2012
Off topic here, Ford. Have you guys noticed sedotz used mIRC creator's picture as his or her avatar? lol I know that ain't Khaled because of his English and its grammar.
 Respond  
RIcko   -  Jun 29, 2012
Any other way of making it look like Napa's one for mIRC?

Im actually an admin in a server and i need this for a quick lookup (a one line lookup)
 Respond  
RIcko   -  Jun 27, 2012
@FordLawnmower, i used that one before but it used to give wrong info from time to time when i tested the results both in the dialog and http://www.ip-adress.com/ip_tracer/
 Respond  
FordLawnmower   -  Jun 27, 2012
@RIcko this script has some extra stuff but will also do the bot portion you see here: http://www.hawkee.com/snippet/6073/
 Respond  
RIcko   -  Jun 27, 2012
This one has more specific info, i wish it was made for mIRC :/
 Respond  
iDLE   -  Apr 19, 2012
Tcl error [Ipinfo]: list element in quotes followed by """ instead of space

Any idea? :(
 Respond  
sedotz   -  Apr 02, 2012
is this still work ?? cos i can load the tcl but no respon at all
 Respond  
napa182   -  Feb 20, 2012
lol @ Xpl0reR
The output for the one I made for msl is as so

Quote


<@napa182> @ipl 113.10.164.138
<&Sick0> :[IP Address]: 113.10.164.138 :[City]: Hong Kong :[State or Region]: Hong Kong (Sar) :[Country]: Hong Kong :[ISP]: NWT IDC Data Service. :[Latitude & Longitude]: 22.247860 114.203384 :[Domain]: 10-EASYLINK.NET.HK

it's not hard to make it into one line as most people can change it to do so.
 Respond  
Xpl0reR   -  Feb 20, 2012
It would be nice to have all of this in a single line of text and not spamming channels with all those lines.
10/10 as usual. nice script.
 Respond  
H2O   -  Sep 01, 2011
FordLawnmower great work as always. i run a few of your scripts. great work man!
 Respond  
irchainscriptz   -  Jun 30, 2011
yup nice work many ppl on koach.com will love this snippet. 10/10
 Respond  
FordLawnmower   -  Jun 29, 2011
Thanks Walkman :)
 Respond  
Walkman   -  Jun 27, 2011
wow nice , gud job fordlawnmower :)
 Respond  
FordLawnmower   -  Jun 22, 2011
Thanks napa182 :)
 Respond  
napa182   -  Jun 21, 2011
Nice work Ford. I had made a IP look up using that same web site in msl awhile ago. It seems to get the data right for the most part. again nice work. 9/10 +like
the only thing i didn't use was the zip code in mine, but i did include the latitude & longitude.
 Respond  
FordLawnmower   -  Jun 21, 2011
@stop I do not have a full script posted.
I do have this addon for mIRC to help with eggdrop connections : http://www.hawkee.com/snippet/7785/
Thanks Aha2Y :)
 Respond  
Aha2Y   -  Jun 21, 2011
Very nice, as always.
 Respond  
stop   -  Jun 21, 2011
FordLawnmower: what iRC are you using? can i download it too? hehe.
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.