07.02.2023, 08:19
This will write UserName to 1/1/0 and OperationID to 1/1/1:
Code:
if not server then
require('socket')
server = socket.udp()
server:setsockname('*', 9999)
server:settimeout(60)
end
data = server:receive()
if data then
data = require('json').pdecode(data)
for _, event in ipairs(data) do
grp.write('1/1/0', event.UserName)
grp.write('1/1/1', event.OperationID)
end
end