-
Notifications
You must be signed in to change notification settings - Fork 121
/
IpAddressLookup.ahk
52 lines (41 loc) · 1.3 KB
/
IpAddressLookup.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include FcnLib.ahk
;109.155.196.7 <== IP address to DDOS! It's possibru!!!
#SingleInstance Force
ip := clipboard
;ip := "109.155.196.7"
ip_site := "http://whatismyipaddress.com/ip/" . ip
MsgBox, 4, , "%ip%" <== value stored in clipboard.`n`nIs this the correct IP to locate?`n`n(Press YES or NO)
IfMsgBox No
exitapp
pwb := ComObjCreate("InternetExplorer.Application")
pwb.Visible := false
pwb.Navigate(ip_site) ;enter your URL here
while pwb.ReadyState <> 4
continue
filedelete, location.txt
loc := pwb.document.all.section_content.InnerText
;get a link for the map
pageTextMess := RemoveLineEndings(loc)
;Clipboard := pageTextMess
;url=https://maps.google.com/maps?q=32.9482,-96.7297&num=1&t=m&z=9
;AllEndings=(Lat|Lon|Geo|Area)
Decimal=. *(-?\d+\.\d+)
LatNeedle=Latitude%Decimal%
LonNeedle=Longitude%Decimal%
;LonNeedle=Lon%Decimal%%AllEndings%
RegExMatch(pageTextMess, LatNeedle, lat)
RegExMatch(pageTextMess, LonNeedle, lon)
;RegExMatch(pageTextMess, "Lat.* (-?\d+\.\d+) .*Lon", lat)
;RegExMatch(pageTextMess, "Lon.* (-?\d+\.\d+) .*(Geo|Area)", lon)
url=https://maps.google.com/maps?q=%lat1%,%lon1%&num=1&t=m&z=9
Run, %url%
msgbox % loc
fileappend, %loc%, location.txt
pwb.Quit
pwb := ""
exitapp
Esc::
pwb.Quit
pwb := ""
exitapp
return