if else lua in macro

BECOME PART OF THE COMMUNITY - Sign up here
  • hy

    i try to do a little macro for exemple running sequence 1 if $bt_1=1

    $bt_1 is equal to 1 when macro 1 is pressing a first time and 0 when pressing a second time like a toggle (juste for exemple)

    i try in commandline

    Lua "if $gp1_bt==1 then CmdIndirect('go sequence 1') end"

    but its doesnt work

    what syntax can i use for using macro variable with lua command?

    thank you very much

    have a good day

    light is live ^^

  • Lua "if "$gp1_bt"==1 then CmdIndirect('go sequence 1') end"

    Would there be a way to do this without LUA?

    Like on MA2 you could compare the value of a variable in the commandline?
    [$test==0] off executor x.y
    [$test==1] go executor x.y

    Reason for asking is that my understanding of LUA is practical zero, and i would like to keep things as simple as possible

    Kind regards,

    Mark van der Meulen

    Edited once, last by MarkvanderMeulen (October 30, 2023 at 9:06 PM).

  • how does $test in your example actually get the values 0 and 1 respectively ?

    the simple approach would be to rather name the variable e.g. $action, and give it the values "Off" or "Go" instead of 0 or 1, and use the single line syntax

    $action executor x.y

  • how does $test in your example actually get the values 0 and 1 respectively ?

    In this case i would use:

    SetUserVariable "test" (give input 0 or 1)

    Or SetUserVar $test= (give input 0 or 1) in MA2

    Which gives a popup asking for an input

    The idea is to turn off an executor with a button press but with an option to cancel this action, so i press the macro which asks to give a value, when pressing a 0 the executor is switched off when pressing a 1 another executor is giving a go+. When giving any other number nothing is happening

    In MA2 we had the option to create a list of actions based on the value of a variable, i'am looking for the same option in MA3 avoiding the use of LUA

    The options you gave with a text in the variable seems logic but takes to much time in a busking show, thats why i would like to use a single number

    Kind regards,

    Mark van der Meulen

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!