PDA

View Full Version : Lau constrains in scripting actions.



Fire
January 14th, 2017, 02:35 AM
Are there any constraints to be aware of when using scripting actions;

I am specifically trying to sort out the following to send a command to a TCP port and then print the response in the Girdir console..

local host, port = "192.168.1.50", 12345
local socket = require("socket")
local tcp = assert(socket.tcp())

tcp:connect(host, port);
tcp:send("TEST;");

while true do
local s, status, partial = tcp:receive()
print(s or partial)
if status == "closed" then break end
end
tcp:close()