Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RPN method for using AAOS on streamdeck

Featured Replies

Hello, I'm trying to create my own commands in MSFS2024 using both AAO and streamdeck. Just like everyone here I assume.

I'm just not able to use the good synthax, I think. 

For example I would like to set the sim rate to 1, using one button. Simmple? not that simple for me since nothing seems to be working.

Here's the code I've wrote

Key down event k: 

(L:SIM_RATE_SET,Number) = 1 (>L:SIM_RATE_SET, Number)

Event Value 1

Of course it's not operative. So, if you have any idea, please HELP ME !!! :)

Thanks for taking time reading my post

 

  • Commercial Member

1. The sim rate cannot be "set", only incremented and decremented using the proper K: simulator events.Setting the rate to a specific value requires more serious scripting.

2. I've never seen that LVar before. Where did you get it, how did you come up with this code? Even if the RPN syntax was correct (it isn't) the script wouldn't acutally do anything of value.

 

LORBY-SI

  • Author

1. OK, copy. You write that it requires more serious scripting. I uinderstand but this answer doesn't really help... Do you have any specific example ? I'm still trying. I managed to read things, such as trim values, environnement values and to command simple things. I just still have trouble wrtiting more complex code since the documentation provided with Axis and ohs is not "that" beginner friendly.

2. For the code, I searched for the name of the value on the SDK and tried writing something that sounded logical but, OK, copy also. 

Thanks for answering.

  • Commercial Member
58 minutes ago, PiLVaLK said:

I just still have trouble wrtiting more complex code since the documentation provided with Axis and ohs is not "that" beginner friendly.

RPN is not an AAO thing - it is the language that the simulator itself "speaks" in the behavior code. AAO is in essence just a translator between you/your hardware and the simulator's SDK.

The place to start with RPN is in the MSFS SDK documentation:

Reverse Polish Notation

Then proceed to the AAO manual, chapter "Scripting". The dialect has been expanded for AAO, while those parts that don't make sense for the app have been removed. 
When starting out, always use the AAO script editor, so you can test your code. Only when it is working, copy it to the StreamDeck - or keep all scripts in AAO itself and call them as K: events - that is the most common implementation.

Also, make sure to take a look around on flightsim.to, there are lots of StreamDeck profiles ready made for all kinds of aircraft. Those usually contain script packages that you can import into AAO.

58 minutes ago, PiLVaLK said:

writing something that sounded logical

That is not how computers operate. You either do it exactly right, or it won't work.

58 minutes ago, PiLVaLK said:

I uinderstand but this answer doesn't really help

Yes, I realize that, but setting the simulation rate is a really complex undertaking, because the native SDK event "(>K:SIM_RATE_SET)" is broken. I cannot offer any solution off the top of my head, I only did this programmatically in the past. I dimly remember that somebody posted scripts about this some months or years ago, but I can't find them. The script must read the simulation rate from the simulator with (P:SIMULATION RATE, Enum) and then use the events (>K:SIM_RATE_INCR) and/or (>K:SIM_RATE_DECR) in succession until the actual rate reaches your intended target value. I cannot recommend trying to edit this directly on the StreamDeck, this must be done in the AAO script editor, saved as a script and then called from the StreamDeck with the appropriate syntax K:scriptgroup-scripttitle (see AAO manual, chapter "Scripting").

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

Here is the best that I can come up with on short notice. I think that there is a better solution out there.

:srloop·\n
(P:SIMULATION·RATE,·Enum)·(L:Scripts-SimRateSet)·<·if{·1·(>K:SIM_RATE_INCR)·(GOTO:srloop)·}·\n
(P:SIMULATION·RATE,·Enum)·(L:Scripts-SimRateSet)·>·if{·1·(>K:SIM_RATE_DECR)·(GOTO:srloop)·}·\n
(END)·\n

The code must be copied exactly like this into the AAO script editor, then saved into Script Group "Scripts" using the title "SimRateSet". Do it differently, and it will either not work or send AAO into a never ending loop. 

To rule out typos, consider importing the script instead:

https://www.dropbox.com/scl/fi/g2u1x6wdgw4o9xov2rwav/SetSimRate_Script.xml?rlkey=a76fqrbs2ndljdh4xnwl46om2&dl=0

The script is then called as 

n (>K:Scripts-SimRateSet)

n is the desired target value for the sim rate (1 for normal real time sim rate, 2, 4, 8, 16 for faster then normal or 0.5 / 0.25 / 0.125 for slower than normal.)

On the StreamDeck you select type K:, then type "Scripts-SimRateSet" into the box, and enter your desired sim rate into the value field.

Edited by Lorby_SI

LORBY-SI

  • Author

OK, this time, I think I understand. 

Reall sorry if I appeared as someone rude, it was not my intention (I'm not a native english speaker). 

I will try your code. Thanks so much for your advices and for you time !!

Hopefully, my skills will grow up fast and I will be able to help people soon

  • Author

Update : IT WORKS !!!

It does exactly what I wanted it to do.

Thanks again

  • Commercial Member

And here is the elegant solution, with out the need for multiline/GOTO

Script Group: "Scripts"
Script Title: "SimRateSetAlt"
Code:

(L:Scripts-SimRateSetAlt)·2·log·near·-2·max·7·min·
(P:SIMULATION·RATE,·Enum)·2·log·-·sp0·
l0·0·<·if{·l0·abs·iterate{·1·(>K:SIM_RATE_DECR)·}next·}
l0·0·>·if{·l0·iterate{·1·(>K:SIM_RATE_INCR)·}next·}

https://www.dropbox.com/scl/fi/31x5kxp1jf6sdjj4syjkw/SetSimRateAlt_Script.xml?rlkey=azd3pobc10n9m0c8gnbja4yzk&dl=0

n (>K:Scripts-SimRateSetAlt)

n is the desired target value for the sim rate (1 for normal real time sim rate, 2, 4, 8, 16 for faster then normal or 0.5 / 0.25 / 0.125 for slower than normal.)

Edited by Lorby_SI

LORBY-SI

  • 1 month later...
  • Author

Sorry for the delay : I was abroad for my work.

I just tried this new version  : I works fine. TYhank you for your new code.

You're just perfect !!

See you !

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.