MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Paulo74
Posts: 3
Hi everybody,

I'm using the mobiflight-event-module in the Community folder to set LVARs from an X-Touch mini using X-Touch-Mini-FS2020.

It's working quite well and I want to add my own settings in the events.user.txt file, but I didn't find any documentation regarding the syntax of this file.

For example I want to increment or decrement the LVAR ASCRJ_FCP_WHEEL by 10. So I tried to add these lines:

iconCode:
ASCRJ_FCP_WHEEL_INC#(L:ASCRJ_FCP_WHEEL, 1) +10 (>L:ASCRJ_FCP_WHEEL)
ASCRJ_FCP_WHEEL_DEC#(L:ASCRJ_FCP_WHEEL, 1) -10 (>L:ASCRJ_FCP_WHEEL)


But unfortunatelly it sets to +10 or -10 the ASCRJ_FCP_WHEEL variable, it doesn't add 10 or -10 to it.

Thank you for your help if you have any ideas on how to solve my problem!
2021-05-31 23:10
Avatar
jaimeleon
Posts: 26
Hello Paulo74
You can read this document on the RPN syntax used in the scripts. They use RPN, or reverse polish notation, which is how old HP engineering calculators used to be. Basically it mimics the operation of a stack and the parameters go first and then the operand. So adding 10 would be (VARIABLE) 10 + (>VARIABLE). Get it?

http://www.prepar3d.com/SDKv3/LearningCenter/utilities/scripting/rpn_scripting.html

Try this, assuming your variables are the correct ones:
iconCode:
ASCRJ_FCP_WHEEL_INC#(L:ASCRJ_FCP_WHEEL, 1) 10 + (>L:ASCRJ_FCP_WHEEL)
ASCRJ_FCP_WHEEL_DEC#(L:ASCRJ_FCP_WHEEL, 1) 10 - (>L:ASCRJ_FCP_WHEEL)



Regards,
Jaime
2021-06-01 02:08
Avatar
Paulo74
Posts: 3
Many thanks! :w00t:

As an old guy I know the RPN but I didn't figure out I have to use it in this file. Will try asap
2021-06-01 17:37
Avatar
Paulo74
Posts: 3
I confirm: it's working B)
2021-06-01 21:48
icon