Advertisement
minimite

location

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