07.03.2017, 08:17
Hi
I am trying to make a script for two meeting rooms with a separation wall. When the wall is open the two rooms should work as one, but when the wall is closed, each room should work seperately.
I have managed to create a script that sends the commands from the push button in room 1 to the eqvivalent GA's in room 2, but when I create the same for room 2 both scripts will run in infinite loops as they trigger each other.
the code I have used so far is:
ga = event.dst
value = event.getvalue()
Magnet = {'1/1/37'} -- Input indicates if wall is open or not
Input = {'1/1/33', '1/1/35'} -- Input addresses from room 1.
Output = {'1/1/34', '1/1/36'} -- Adresses in room 2.
-- When pushin buttons in room 1
for id, addr in ipairs(Input) do
if ga == addr and Magnet == true then
grp.write(Output[id], value)
end
end
I am trying to make a script for two meeting rooms with a separation wall. When the wall is open the two rooms should work as one, but when the wall is closed, each room should work seperately.
I have managed to create a script that sends the commands from the push button in room 1 to the eqvivalent GA's in room 2, but when I create the same for room 2 both scripts will run in infinite loops as they trigger each other.
the code I have used so far is:
ga = event.dst
value = event.getvalue()
Magnet = {'1/1/37'} -- Input indicates if wall is open or not
Input = {'1/1/33', '1/1/35'} -- Input addresses from room 1.
Output = {'1/1/34', '1/1/36'} -- Adresses in room 2.
-- When pushin buttons in room 1
for id, addr in ipairs(Input) do
if ga == addr and Magnet == true then
grp.write(Output[id], value)
end
end
There are 10 kinds of people in the world; those who can read binary and those who don't