Scripting: Using Variables and Math in CCs
2 posters
Page 1 of 1
Scripting: Using Variables and Math in CCs
I am working on a series of buttons. One type of button is a toggle that will turn on and off with specific values. To make changing the values easier for each button, I would like to use variables. I get an error about the channel needing to be between 1-16 with this script.
I know I am doing something incorrectly here. Would anyone be able to point me in the right direction?
Thanks, - J
I know I am doing something incorrectly here. Would anyone be able to point me in the right direction?
Thanks, - J
- Code:
[(init){@local_bu:3} {@local_ch:1} {@local_co:1}]
[(press){cc:#@local_ch#,#@local_co#,#@local_bu#}]
[(release){state:1}]
[(press){cc:#@local_ch#,#@local_co#,#@local_bu+64#}]
[(release){state:0}]
[(cc:#@local_ch#,#@local_co#,#@local_bu#){state:1}{nextpress:2}]
[(cc:#@local_ch#,#@local_co#,#@local_bu+64#){state:0}{nextpress:1}]
jtints- Posts : 37
Join date : 2024-01-22
Re: Scripting: Using Variables and Math in CCs
Unfortunately, the script engine does not handle variable references in events like that.
You can have a variable event where the event triggers the command if a variable value fulfills the event, e.g., (@local_bu:10), but besides that, you can't have variable references and math in events.
You can have a variable event where the event triggers the command if a variable value fulfills the event, e.g., (@local_bu:10), but besides that, you can't have variable references and math in events.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum