RichardJ Posted March 1, 2009 Share Posted March 1, 2009 I am trying to construct a three position switch so each time you press on the object it increments the value and changes to the next position. 0 = off 1 = Manual 2 = Auto I have tried two different scripts -----1----- If (Ambient_Process_1_Switch [0] < 2 then Ambient_Process_1_Switch + 1 else Ambient_Process_1_Switch = 0) endif -----2----- if (Ambient_Process_1_Switch [0] == 0) then (Ambient_Process_1_Switch = 1) endif if (Ambient_Process_1_Switch [0] == 1) then (Ambient_Process_1_Switch = 2) endif if (Ambient_Process_1_Switch [0] == 2) then (Ambient_Process_1_Switch = 0) Can anyone advise how to progress? Regards Richard endif Link to comment Share on other sites More sharing options...
AzeoTech Posted March 2, 2009 Share Posted March 2, 2009 Use a Quick Sequence on the button: Ambient_Process_1_Switch[0]++ if (Ambient_Process_1_Switch[0] > 2) Ambient_Process_1_Switch [0] = 0 endif A few notes on your code: 1) [0] should be right after the channel name. No spaces. 2) there is no "then" in the if() syntax Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.