#✅ | Using Is text statement to change a buttons text

1 messages · Page 1 of 1 (latest)

warm sinew
#

hello, i want to make a button that changes its text whenever another button does. i want it to refer to what the text on the other button says. tihs is what one of the helpers suggested to me:

{"placeholder":"vanillabuttonlabel","values":{"locator":"title_screen:604322"}} - put this in an "Is Text" if statement and make it look for "VR: ON" to set the variable in charge of the button label to "Enabled", else set the variable to "Disabled"

can you please help me do this

spice sparrowBOT
# warm sinew hello, i want to make a button that changes its text whenever another button doe...

Here’s how you can mirror the other button’s label by reading it with {"placeholder":"vanillabuttonlabel",…} and feeding that into a variable:

  1. Create a variable (via Customization → Variables → Manage Variables) called, for example, vr_button_state. Set it to either Enabled or Disabled as default.

  2. Make the “follower” button show that variable: edit its label and use the placeholder {"placeholder":"getvariable","values":{"name":"vr_button_state"}}. That way its text always reflects whatever the variable currently stores.

  3. Add a Ticker (or any element with an action script) that runs every tick (or whenever the screen loads). Inside its action script:

    • Add an IF statement.
    • For the Is Text requirement, use the calculator-style value that combines the placeholder and the comparison, e.g.
      ["mode":"equals","text":"{"placeholder":"vanillabuttonlabel","values":{"locator":"title_screen:604322"}}","compare_with":"VR: ON"]$
    • Inside the IF, add a Set Variable action with vr_button_state:Enabled.
    • Append an ELSE and set vr_button_state:Disabled.
  4. Save everything. The ticker will constantly read the other button’s actual label (via the vanillabuttonlabel placeholder) and update your variable, so the follower button’s label reacts instantly.

For reference, see how to build action scripts/IF logic here: Action Scripts and how placeholders work here: Placeholders.

warm sinew
#

can you make the ticker only tick if the screen its on is visible

spice sparrowBOT
# warm sinew can you make the ticker only tick if the screen its on is visible

Tickers already only run while the layout they belong to is loaded—which means the screen where the layout is applied must be open. As soon as the screen closes (or the layout unloads), the ticker stops ticking automatically. So to keep it limited to that screen, just make sure the layout containing the ticker is only enabled for that screen (or gated with loading requirements that match the screen).

If you want to control how often it runs while the screen is open, use the Ticker’s Tick Mode options (e.g., “On Load Screen” to run once per open, or “Normal” to run continuously). More on tickers and their modes is in the Elements → Ticker section.