Hi, I'm not very knowledgeable about Lua programming. I have several of the same scripts that are different in group addresses. The latter shifts by 1, for example 1/3/10, 1/3/11 etc. Is it possible to write one universal script that would adjust the other addresses in it according to the incoming address and execute?
thanks
example:
roofopenclose = grp.getvalue('2/3/10') --address coming from basalte
roofopen = grp.getvalue ('2/3/200') --address for the actuator
roofclose = grp.getvalue ('2/3/201') -- address for the actuator
if roofopenclose == false then
grp.write('2/3/200',1) --command OPEN for ROOF 1 actuator
os.sleep(1) --long push
grp.write('2/3/200',0) --command for actuator
elseif roofopenclose == true then
grp.write('2/3/201',1) --command CLOSE for ROOF 1 actuator
os.sleep(1) --long push
grp.write('2/3/201',0) --command for actuator
end
thanks
example:
roofopenclose = grp.getvalue('2/3/10') --address coming from basalte
roofopen = grp.getvalue ('2/3/200') --address for the actuator
roofclose = grp.getvalue ('2/3/201') -- address for the actuator
if roofopenclose == false then
grp.write('2/3/200',1) --command OPEN for ROOF 1 actuator
os.sleep(1) --long push
grp.write('2/3/200',0) --command for actuator
elseif roofopenclose == true then
grp.write('2/3/201',1) --command CLOSE for ROOF 1 actuator
os.sleep(1) --long push
grp.write('2/3/201',0) --command for actuator
end