Hello to all
How can I get the country like the following code?
on show
How can I get the country like the following code?
Código: Seleccionar todo
function GetPublicIP(webip)
local webip = webip or 'http://my.ipaddress.is/';
local ret;
local ip;
local pip = "";
ret =HTTP.Submit(webip,{},SUBMITWEB_GET, 20, 80, nil, nil);
if ret ~= "" then
ip=ret:match("%d+%.%d+%.%d+%.%d+");
if ip ~= nil and ret ~= ip then
pip = ip;
end
else
pip = "";
end
return pip;
end
Código: Seleccionar todo
local ip=GetPublicIP(webip);
Input.SetText("Input1", ip);