This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Obtain IP address of Logic Machine
#1
Hi,

In some of my scripts it would be useful to know the IP address of the Logic Machine on which they run.
Now I use something I found somewhere:


Code:
require('socket')
local s = socket.udp()
s:setpeername("192.168.1.1",80)
local ip, _ = s:getsockname()
log(ip)


I don't know how it works, but it works (and does not require a connection to the IP address in the script. As a matter of fact that IP address is irrelevant).
Is there a more elegant solution?
Thanks
Reply


Messages In This Thread
Obtain IP address of Logic Machine - by baggins - 14.12.2017, 16:26

Forum Jump: