I am unable to program multiple actions for 1 switch in the iFly 737 Max8 (example: turn on all the fuel pumps with one switch). I can create the inputs and assign them to the same switch, but the only one that actions is the last one entered. Same goes for other systems as well. No problem with other aircraft. Any ideas? MSFS 2020
#Can only program one input command to a switch
1 messages · Page 1 of 1 (latest)
The issue is the method used by iFly to receive commands by assigning different values to the same Lvar.
Because it is the same Lvar, each command needs to be processed, the Lvar needs to be reset, and only then the same Lvar can be used for another command.
You can do two commands by assigning one to on press and a second command to on release.
There are hacky ways with RPN to do stacked time delayed commands. I would only recommend that if you are confortable with RPN.
Thanks. Makes sense. I will research the RPN option as it applies in Mobiflight
You will need to use custom Lvars, and the (E:SIMULATION TIME,second) variable
For example, this code will store the current time in seconds plus half a second to a custom Lvar
(E:SIMULATION TIME,second) 0.5 + (>L:MyDelayTime)
I had forgotten I had written this block of code for exactly this use case
For the input trigger event (bound to a button on press)
(E:SIMULATION TIME,second) 0.5 + (>L:myTimer)
1 (>L:WHATEVER LVAR TO BE SET)
You will need an Output config with this code:
(L:myTimer) 0 != if{
(E:SIMULATION TIME,second) (L:myTimer) > if{
(E:SIMULATION TIME,second) 0.5 + (>L:myTimer)
(L:myCount) 4 < if { (L:myCount) ++ (>L:myCount) }
els{ 0 (>L:myCount) 0 (>L:myTimer) quit }
(L:myCount) 1 == if{ 2 (>L:WHATEVER LVAR TO BE SET) quit }
(L:myCount) 2 == if{ 3 (>L:WHATEVER LVAR TO BE SET) quit }
(L:myCount) 3 == if{ 4 (>L:WHATEVER LVAR TO BE SET) quit }
In this case WHATEVER LVAR TO BE SET is the Lvar name for the iFly function you wish to trigger
the number in front of the Lvar also needs to be set to the actual value expected to trigger the desired function
The time delay is arbitrarily set to 0.5 seconds per trigger step. You can adjust that as you wish.
L:myTimer is the user defined delay time variable. If this variable is equal to 0 all the code is ignored.
I am trying another route. I have created the following Lua Script in FSUIPC7;
ipc.execCalcCode(6 (>L:VC_Fuel_trigger_VAL,number))
ipc.sleep(100)
ipc.execCalcCode(8 (>L:VC_Fuel_trigger_VAL,number))
ipc.sleep(100)
ipc.execCalcCode(10 (>L:VC_Fuel_trigger_VAL,number))
ipc.sleep(100)
ipc.execCalcCode(12 (>L:VC_Fuel_trigger_VAL,number)) . I am having difficulty accessing the script through the FSUIPC - Lau Macro option in Mobiflight. Any ideas
I have put the Lua file in my FSUIPC.ini file and am putting "fuelon" in the macro name line. Do I need to pit anything in the Value line?
I know the Calculator code for each comman works as I tried them directly through FSUIPC7
there is a slight syntax error with your lua script i believe try ipc.execCalcCode("6 (>L:VC_Fuel_trigger_VAL,number)") ipc.sleep(100) ipc.execCalcCode("8 (>L:VC_Fuel_trigger_VAL,number)") ipc.sleep(100) ipc.execCalcCode("10 (>L:VC_Fuel_trigger_VAL,number)") ipc.sleep(100) ipc.execCalcCode("12 (>L:VC_Fuel_trigger_VAL,number)")
then in the macro name box its Lua fuelon with value of 1