Local variables
Posted: Monday 18 October 2021 20:07
Hello,
Im new with Lua programming and im trying to make a little script without the
user variables. Im looking for a solution with local variables.
An example of my code:
commandArray = {}
local variable = uservariables['WhatsappTimer']
if (otherdevices['Test schakelaar 1'] == 'On') then
variable = 1 AFTER 3 SECONDS
commandArray['Test schakelaar 1'] = 'Off'
end
if (variable == 1) then
commandArray['Test schakelaar 2'] = 'On'
variable = (0)
end
return commandArray
Is it possible to make a script like this without the uservariable WhatsappTimer?
Im new with Lua programming and im trying to make a little script without the
user variables. Im looking for a solution with local variables.
An example of my code:
commandArray = {}
local variable = uservariables['WhatsappTimer']
if (otherdevices['Test schakelaar 1'] == 'On') then
variable = 1 AFTER 3 SECONDS
commandArray['Test schakelaar 1'] = 'Off'
end
if (variable == 1) then
commandArray['Test schakelaar 2'] = 'On'
variable = (0)
end
return commandArray
Is it possible to make a script like this without the uservariable WhatsappTimer?