Page 1 of 1

Running a script for as long as a button is held

Posted: Thu Oct 10, 2019 7:55 pm
by jackwilsdon
I've got a script which sets lights to random colors, and I'd like it to hold the channels at the levels it chose until a button is released.

Here is the script I'm using:

Code: Select all

setfixture:0 ch:5 val:255 // Dimmer
setfixture:0 ch:7 val:random(0,255) // Red
setfixture:0 ch:8 val:random(0,255) // Green
setfixture:0 ch:9 val:random(0,255) // Blue
setfixture:0 ch:10 val:random(0,255) // White
What can I do to attach this to a "flash" button so that it holds its value until the button is released? I know I could add a fixed "wait" time, however I want the values to stop being held when the button is released.

Re: Running a script for as long as a button is held

Posted: Fri Oct 11, 2019 7:54 am
by mlohrey
Not exactly sure what you want but you need to add some wait time to the script. Otherwise it just runs and stops.

If you make the wait time very large, it effectively just continues to run and then you can use a button to end it.
Random Colour.qxw
(2.41 KiB) Downloaded 41 times

Re: Running a script for as long as a button is held

Posted: Fri Oct 11, 2019 10:50 am
by jackwilsdon
It looks like the rest of my post somehow ended up in my code block! I'm looking to attach a script to a flash button somehow so that the random color is held only for the duration that the button is held down - I don't think I can use a wait for this? Is there any way at all to hook a script up to a flash?