Advertisement
westor

IP-Lookup fixed for OrFeAsGr v1.0

Feb 7th, 2016
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.72 KB | None | 0 0
  1. on *:sockopen:iplook: {
  2.   if ($sockerr) {
  3.     var %c = $gettok($sock($sockname).mark,1,32)
  4.     if ($me ison %c) { .msg %c There was an connection error between the website and ip-info! - (Error Code: $sock($sockname).wserr $+ ) - (Error Details: $sock($sockname).wsmsg $+ ) }
  5.     sockclose $sockname
  6.     return
  7.   }
  8.   sockwrite -nt $sockname GET $gettok($sock($sockname).mark,2,32) HTTP/1.1
  9.   sockwrite -nt $sockname User-Agent: Mozilla/4.0
  10.   sockwrite -nt $sockname Host: whatismyipaddress.com
  11.   sockwrite $sockname $crlf
  12. }
  13.  
  14. on *:sockread:iplook: {
  15.   if ($sockerr) {
  16.     var %c = $gettok($sock($sockname).mark,1,32)
  17.     if ($me ison %c) { .msg %c There was an connection reading error between the website and ip-info! - (Error Code: $sock($sockname).wserr $+ ) - (Error Details: $sock($sockname).wsmsg $+ ) }
  18.     sockclose $sockname
  19.     return
  20.   }
  21.   var %read
  22.   sockread %read
  23.   ;echo -at %read
  24.   if (*!*PAC* iswm %read) { set -e %ippac 1 }
  25.   if (%ippac) {
  26.     ;echo -at $findtok(%read,>,0,62)
  27.     if (*Decimal:* iswm %read) { set -e %decimal $iif($gettok($gettok(%read,$calc($findtok(%read,Decimal:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
  28.     if (*Hostname:* iswm %read) { set -e %hostname $iif($gettok($gettok(%read,$calc($findtok(%read,Hostname:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
  29.     if (*ASN:* iswm %read) { set -e %asn $iif($gettok($gettok(%read,$calc($findtok(%read,ASN:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
  30.     if (*ISP:* iswm %read) { set -e %isp $iif($gettok($gettok(%read,$calc($findtok(%read,ISP:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
  31.     if (*Organization:* iswm %read) { set -e %org $iif($gettok($gettok(%read,$calc($findtok(%read,Organization:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
  32.     if (*Type:* iswm %read) { set -e %type $iif($gettok($gettok(%read,$calc($findtok(%read,Type:</th,1,62) + 3),62),1,60) == /td, Not Found, $v1) }
  33.     if (*Assignment:* iswm %read) { set -e %assign $iif($gettok($gettok(%read,$calc($findtok(%read,Assignment:</th,1,62) + 3),62),1,60) == /td, Not Found, $v1) }
  34.   }
  35.   if (*/table></form* iswm %read) {
  36.     var %c = $gettok($sock($sockname).mark,1,32)
  37.     unset %ippac
  38.     if ($me ison %c) { msg %c $iif(%decimal !== NA, 3Decimal:7 $v1,N/A) $iif(%hostname !== NA, 3Hostname:7 $v1,N/A) $iif(%asn !== NA, 3ASN:7 $v1,N/A) $iif(%isp == %org && %isp !== NA, 3ISP/Org:7 %isp, $iif(%isp !== NA, 3ISP:7 %isp,N/A) $iif(%org !== NA, 3Organization:7 $v1,N/A)) $iif(%type !== NA, 3Type:7 $v1,N/A) $iif(%assign !== NA, 3Assignment:7 $v1,N/A) }
  39.   }
  40.   if (*h2 id="Geolocation-Information* iswm %read) { set -e %geost 1 }
  41.   if (*Continent:* iswm %read) { set -e %continent $gettok($gettok(%read,$calc($findtok(%read,Continent:</th,1,62) + 2),62),1,60) }
  42.   if (*Country:* iswm %read) { set -e %country $gettok($gettok(%read,$calc($findtok(%read,Country:</th,1,62) + 2),62),1,60) }
  43.   if (*State/Region* iswm %read) { set -e %streg $gettok($gettok(%read,$calc($findtok(%read,State/Region:</th,1,62) + 2),62),1,60) }
  44.   if (*City* iswm %read) { set -e %city $gettok($gettok(%read,$calc($findtok(%read,City:</th,1,62) + 2),62),1,60) }
  45.   if (*Latitude* iswm %read) { set -e %findlat 1 }
  46.   if (%findlat) && (*Latitude* !iswm %read) {
  47.     unset %findlat
  48.     set -e %latitude $gettok(%read,1,38)
  49.   }
  50.   if (*Longitude* iswm %read) { set -e %findlong 1 }
  51.   if (%findlong) && (*Longitude* !iswm %read) {
  52.     unset %findlong
  53.     set -e %longitude $gettok(%read,1,38)
  54.   }
  55.   if (*Postal* iswm %read) { set -e %PostalCode $gettok($gettok(%read,$calc($findtok(%read,Postal Code:</th,1,62) + 2),62),1,60) }
  56.   if (*/table* iswm %read) && (%geost) {
  57.     var %c = $gettok($sock($sockname).mark,1,32)
  58.     if ($me ison %c) { msg %c $iif(%continent,3Continent:7 $v1,N/A) $iif(%country, 3Country:7 $v1,N/A) $iif(%streg, 3State/Region:7 $v1,N/A) $iif(%city, 3City:7 $v1,N/A) $iif(%latitude, 3Latitude:7 $v1,N/A) $iif(%longitude, 3Longitude:7 $v1,N/A) $iif(%postalcode, 3Postal Code:7 $v1,N/A) }
  59.     unset %geost
  60.     unset %isp
  61.     unset %hostname
  62.     unset %decimal
  63.     unset %org
  64.     unset %asn
  65.     unset %assign
  66.     unset %type
  67.     unset %iplook
  68.     unset %ipchan
  69.     unset %continent
  70.     unset %country
  71.     unset %streg
  72.     unset %city
  73.     unset %latitude
  74.     unset %lognitude
  75.     unset %postalcode
  76.     sockclose $sockname
  77.     return
  78.   }
  79. }
  80.  
  81. on *:TEXT:*:#: {
  82.   tokenize 32 $strip($1-)
  83.   if ($1 == !ipinfo) {
  84.     if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an IP address! | return }
  85.     if ($remove($2,.) !isnum) { .msg $chan ( $+ $+ $nick $+ ): Error, Please specify an IP correctly! | return }
  86.     msg $chan Looking Up IP: $2
  87.     sockopen iplook whatismyipaddress.com 80
  88.     sockmark iplook $chan $+(/ip/,$2)
  89.   }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement