iplookup.tcl

By BigSteve on Sep 02, 2011

this is an IP lookup script I created which was originally a mirc code :3
mirc one was thanks to Jethro_
note bot must have oper and must be in #services room
but you can change the #services to whatever you wish

package require http 2.4

bind join - "#yourmainchannelhere *" getJoin
bind RAW - 340 getIP
proc getIP { from keyword text } {
set index [string first "@" $text]
set pindex1 [string last ":" $text]
incr pindex1 1
set pindex2 [string last "=" $text]
incr pindex2 -1
set person [string range $text $pindex1 $pindex2]
incr index 1
set userIP [string range $text $index [string length $text] ]
set http [::http::geturl "http://www.ipligence.com/geolocation" \
        -query [::http::formatQuery "ip" $userIP] -timeout 9000]
set data [split [::http::data $http] \n] ; ::http::cleanup $http
for {set index [llength $data]} {$index >=0 } {incr index -1} {
if {[regexp {Your IP address is } [lindex $data $index] url] } {
set result ""
append result [lindex $data $index]
while {[string first "<" $result] != -1} {
        set idx1 [string first "<" $result]
        set idx2 [string first ">" $result]
        set result [string replace $result $idx1 $idx2 "   "]
}
set idx1 [string first "City" $result]
incr idx1 -1
set result [string replace $result 0 $idx1]
set idx2 [string first Time $result]
set result [string replace $result $idx2 [string length $result]]
set chanmsg "$person using IP address $userIP connection from: "
set chanmsg $chanmsg$result
putserv "Privmsg #services :\0034 $chanmsg"

}
}

}

Comments

Sign in to comment.
itskamel   -  Dec 16, 2011

any instructions on how to use this at all?

 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.