Running a script for as long as a button is held

Ask a generic question about the usage of QLC+, not related to a particular operating system
Post Reply
jackwilsdon
Posts: 2
Joined: Thu Oct 10, 2019 7:51 pm
Real Name:

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.
Last edited by jackwilsdon on Fri Oct 11, 2019 10:49 am, edited 1 time in total.
mlohrey
Posts: 243
Joined: Mon Apr 20, 2015 5:07 am
Real Name: Mark Lohrey

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
Last edited by mlohrey on Wed Feb 19, 2020 6:15 am, edited 1 time in total.
jackwilsdon
Posts: 2
Joined: Thu Oct 10, 2019 7:51 pm
Real Name:

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?
Post Reply