MikeL Posted December 17, 2021 Share Posted December 17, 2021 Need help with a lighting script. I have a button on my SR 250 set up to cycle through three options. If lights are off lights then go to dim. If you hit the button while the lights are on dim they go to full on. If you hit the buttons while the lights are full on it turns off. It doesn’t seem to be working properly. I took a photo of the script, but not sure how to post? If anyone can direct me on how to program this, or if I can somehow DM somebody a photo of the script I would appreciate it. Quote Link to comment Share on other sites More sharing options...
MikeL Posted December 17, 2021 Author Share Posted December 17, 2021 Here is the current script. Quote Link to comment Share on other sites More sharing options...
Dr. Venkman Posted December 17, 2021 Share Posted December 17, 2021 The commands in the lower portion need to be nested under the conditional, as they are in the first one. Just drag the commands to the question mark, and it will nest them. As it is right now, it's checking the condition, then there's no programming on the condition, then it's moving on. It's running the lower commands every time (well, until you get to the first "Stop"). Quote Link to comment Share on other sites More sharing options...
C4 User Posted December 17, 2021 Share Posted December 17, 2021 In addition to properly nesting your programming for ON and OFF events to match the DIM event, I would suggest: - change the programming for the ON event to > than 5% rather than using = 10% (it will be more reliable). But better yet, if you move this to the 3rd position as I mention below, drop the IF and simply execute the DIM event if the lights are not OFF and are not >50%. - move the OFF event to the 2nd position and the ON event to the 3rd position (check if lights are >50% before you check if they are >5%). - delete the 3 second delay nested in each event and put one 3 second day above the 2nd event (but not nested) Hope this all makes sense. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted December 17, 2021 Share Posted December 17, 2021 Come to above pretty much cover everything. The 3 second delay is not needed at all. 3 seconds before a stop event does absolutely nothing under any circumstance. Personally, I would use else instead of stop. Easier to understand (arguably) but the result is the same. Quote Link to comment Share on other sites More sharing options...
MikeL Posted December 17, 2021 Author Share Posted December 17, 2021 How do I nest a command vs non nested? Quote Link to comment Share on other sites More sharing options...
OceanDad Posted December 17, 2021 Share Posted December 17, 2021 3 hours ago, MikeL said: How do I nest a command vs non nested? Drag the arrow so that it's on top of the question mark. Voila, the command will indent/nest. Not completely intuitive the first time you do it, but you won't forget it. Quote Link to comment Share on other sites More sharing options...
MikeL Posted December 20, 2021 Author Share Posted December 20, 2021 Thank you all for your help. I’ve got it working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.