Extra Usage:
You can add a custom message of your own, e.g only the values you want
I.e There is the default message %ipin.all that contains all values
but you can you use %ipin.
For example %ipin.decimal will return the decimal
%ipin.hostname will return the hostname and so on for every item
NOTE: Postal Code variable is %ipin.Postalchr32Code
;;;IP LOOKUP by OrFeAsGr;;;;;;;;;;;
;;;v1.8 ;;;
;;;The Script is working again! ;;;
;;;All same features except DNSBL check;;;
;;; Reduced lines a lot! The script is now smaller, faster, and more practical ;;;
;;; 10/02/2018 ;;;
;;; Thx for the support, if you find any bugs let me know :);;;
;;; Donating is helpful: paypal.me/OrFeAsGr ;;;
on *:sockopen:iplook: {
if ($sockerr) { echo -at Error While Looking Up IP }
sockwrite -nt $sockname GET %iplook HTTP/1.1
sockwrite -nt $sockname User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246
sockwrite -nt $sockname Host: $ipinfohost
sockwrite $sockname $crlf
}
on *:sockread:iplook: {
if ($sockerr) { echo -at Error While Looking Up IP }
var %read | sockread %read
;echo -at %read
if (*table* iswm %read) { inc %ipin.table 1 }
if (%ipin.table == 1) || (%ipin.table == 3) {
if (*table* !iswm %read) {
var %read = $remove($replace(%read,</th><td>,$chr(32)),<tr><th>,</td></tr>)
tokenize 58 %read
var %item = $+($replace($1,$chr(32),chr32),:)
var %value = $iif(%item == Country:, $gettok($2,1,60), $iif($istok(Type: Assignment:,%item,32),$gettok($gettok($2,2,62),1,60),$2))
if (!$istok(Latitude: Longitude: Blacklist:,%item,32)) && ($istok(IP: Decimal: Hostname: ISP: Organization: Services: Type: Assignment: Continent: Country: State/Region: City: Postalchr32Code:,%item,32)) { set %ipin.all $addtok(%ipin.all,%item %value,32) | set $+(%,ipin.,%item) %value }
if ($istok(Latitude: Longitude:,%item,32)) { set %grabnext %item }
if (%grabnext) && (%item != %grabnext) { set $+(%,ipin.,%grabnext) $gettok(%read,1,38) | unset %grabnext }
if (%ipin.longitude:) && (!%ipin.map) { set %ipin.map 1 | set %ipin.all $addtok(%ipin.all,Location: $+(http://maps.google.com/maps?q=loc:,%ipin.latitude:,$chr(44),%ipin.longitude:,&z=7),32) }
}
}
if (%ipin.table == 2) { $iif(%mon = !, msg, notice) %ipchan %ipin.all | unset %ipin.all }
if (%ipin.table == 4) { $iif(%mon = !, msg, notice) %ipchan $replace(%ipin.all,chr32,$chr(32)) | sockclose $sockname | unset %ipin.* }
}
alias iplookup { set %ipchan $2 | set %iplook $+(/ip/,$1) | $iif(%mon == !, msg, notice) $2 Looking Up IP: $1 | sockopen -e iplook $ipinfohost 443 }
on *:TEXT:*:*: {
if ($mid($1,2) == ipinfo) && ($istok(! @,$left($1,1),32)) {
inc %ipusageadv 1
if (%ipusageadv == 200) { .timet 1 20 msg $chan IP Look Up By OrFeAsGr mirc-land.tk --- orpheusgr.tk (Art) }
set %mon $left($1,1)
if ($remove($strip($2),.) isnum) {
iplookup $strip($2) $iif($left($1,1) == !, $iif($chan, $v1, $nick), $iif($left($1,1) == @, $nick, $chan))
}
if ($remove($strip($2),.) !isnum) {
set %ipchan $iif($left($1,1) == !, $iif($chan, $v1, $nick), $iif($left($1,1) == @, $nick, $chan))
.dns -h $strip($2)
}
}
}
on *:DNS: {
if (%ipchan) {
if ($raddress) {
iplookup $raddress %ipchan
}
elseif (!$raddress) {
msg %ipchan 3Error14: 7Hostname Could Not Be Resolved14.
}
}
}
alias ipinfohost { return $decode(d2hhdGlzbXlpcGFkZHJlc3MuY29t, m) }
;;;IP LOOKUP by OrFeAsGr;;;;;;;;;;;
;;; http://humanity.ucoz.com - Humanity IRC Bot ;;;;;
;;; Donating is helpful: paypal.me/OrFeAsGr ;;;
Unfortunately I cannot confirm this.
I get a "Hostname Could Not Be Resolved".
(I was trying to find a script which allows to determine my own IP as mIRC fails to fill in the correct ident data when behind a BNC and hoping to modify this, but as the original usage already fails, that's bad luck)