I get the error when trying to dofile on a lua script which just has a function defined.
error: stdin:1: attempt to index global 'senddata' (a nil value)
What's the usual cause for this?
code works from inside the function if I copy and paste it.
function sendData()
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end)
conn:connect(5050,'192.168.1.8')
conn:send("add|"..t.read().."|ceiling\n")
conn:close()
end