08.08.2019, 07:30
Hello,
I am using this script: https://forum.logicmachine.net/showthread.php?tid=1035 to ping an IP adress of a laptop in the same network as the LM is. It somewhy does not work, I transformed script into this:
But it always logs disconected, no matter what I try. If I ping the IP from cmd, it pings fine. Where could be the problem?
Thank You.
I am using this script: https://forum.logicmachine.net/showthread.php?tid=1035 to ping an IP adress of a laptop in the same network as the LM is. It somewhy does not work, I transformed script into this:
Code:
function socketping(ip, port, timeout)
port = port or 80
local sock = require('socket').tcp()
sock:settimeout(timeout or 20)
local res, err = sock:connect(ip, port)
log(res)
log(err)
sock:close()
return res, err
end
ip = '192.168.100.149'
if socketping(ip) then
log('CONNECTED')
grp.write('0/0/9', true)
else
log('DISCONECTED')
end
Thank You.