28.10.2023, 08:25
(This post was last modified: 28.10.2023, 08:27 by Erwin van der Zwart.)
Just add a if condition like this:
But if the value is not change often i would make it event based, initiate the connection, write the command and close the connection..
Code:
if previousvalue ~= value then
-- send command
sock:send (command)
previousvalue == value
end