Quick Sign In:  

Forum: General Discussion

Topic: Script to activate/deactivate a custom button
chirroHome userMember since 2020
Hello. Is there any way to activate/deactivate a custom button (with actions) using a script?

I have some mapped custom buttons and I want one of them (when turning on) to save the state of these custom buttons and apply an action and when turning off, restore the saved state and make another action.
 

Posted Thu 18 Jan 24 @ 8:47 am
locoDogPRO InfinityModeratorMember since 2013
There is no on/off with custom_buttons, there's just pressed. So you need to use something to track the logic yourself.

toggle myLogicVar & var myLogicVar 1 ? do something : do something else

custom_button 2 is a call to use a custom_button, anything that performs script can make a custom_button call, EXCEPT custom_buttons can't call custom_buttons, but there are workarounds if you really need to.
 

Posted Thu 18 Jan 24 @ 9:04 am
chirroHome userMember since 2020
Thanks Locodog.

Can you write a simple example of this?

One script in a custom button called 'button_1' that when pressed toggles another custom button called 'button_2'

And please, forgive my bad English
 

Posted Thu 18 Jan 24 @ 9:11 am
locoDogPRO InfinityModeratorMember since 2013
erm no, there is no simple way,
you have to route thru a multibutton or a padpage pad.
99% of the time you can just write your custom_button in a way that custom_button presses custom_button isn't needed.
 

Posted Thu 18 Jan 24 @ 9:49 am
chirroHome userMember since 2020
Ok. Thanks again.
 

Posted Thu 18 Jan 24 @ 9:51 am