Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --get location
- local locr = http.get("http://api.hostip.info/get_html.php")
- local loc = locr.readAll()
- --remove IP line, we don't need it
- local loc = loc:gsub("\nIP: [^\n]*", "")
- --if couldn't find location
- if string.find(loc, "Unknown") then
- print("Unknown location-IP's location may be private?")
- else
- print(loc)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement