Finds a user's IP address, assuming their host is not masked. Locates the IP address on the map and displays all of the information available, including country, region/state, and city. To use, right click a user's name in the nicklist and click "Locate."
menu nicklist {
.Locate:set %ipnick $$1 | checkloc $address($$1,2)
}
alias checkloc {
var %o = $remove($gettok($1,2,$asc(@)),.)
if (%o isnum) {
echo -a 2Nick: %ipnick
checkip $gettok($1,2,$asc(@))
halt
}
if (%o isalpha) || (*undernetorg iswm %o) {
echo -at %ipnick $+ 's host/IP is masked! Cannot continue.
sockclose checkip
unset %ipadd
unset %ipon
halt
}
else {
.dns $1
set %ipon on
}
}
alias checkip {
if (*.*.*.* iswm $1) {
set %ipadd $1
sockopen checkip geobytes.com 80
}
else echo -at Use /checkip <valid IP address>
}
on *:sockread:checkip:{
if ($sockerr) {
echo -a Error.
sockclose checkip
unset %ipadd
unset %ipon
halt
}
else {
var %', %boo, %get
sockread %'
%boo = $z(%')
%get = $gettok(%',6,$asc("))
if (*ro-no_bots_pls13* iswm %') echo -a 2Country: %get
if (*ro-no_bots_pls15* iswm %') echo -a 2Region/State: %get
if (*ro-no_bots_pls17* iswm %') echo -a 2City: %get
if (*</html>* iswm %') {
sockclose checkip
unset %ipadd
unset %ipon
halt
}
}
}
on *:DNS:{
if (%ipon == on) {
checkip $dns(1).ip
echo -a 2Nick: %ipnick
unset %ipnick
}
}
alias -l z {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
on *:sockopen:checkip:{
sockwrite -n $sockname GET /IpLocator.htm?getlocation&ipaddress= $+ %ipadd HTTP/1.1
sockwrite -n $sockname Host: geobytes.com $+ $crlf $+ $crlf
}