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.

Complex script(s)

Featured Replies

Hi,

I'd like to use only one encoder from my x-touch-mini for transponder.

The idea is to click on the encoder to switch from unith to tenth to hundredth to thousandth of the encoder. I mean put the XPNDR_SELECTION var to 1 then 10 then 100 then 1000.

And moving the encoder up and down, increment or decrement the value : 

By example : if the XPNDR_SELECTION is set to 100, send value 1 to XPNDR_100_INC for each step.

Is it possible ? Is there a way to do it ?

Jean-Luc

  • Commercial Member

Sure, nothing to it. Use an AAO-internal LVar to store the current digit position (0-3). LVars don't have to be "defined", they start to "live" first time AAO sees them. Then make one script to advance through the 4 values, and two other scripts that INC/DEC the digit that is referenced by that LVar.

But. Be mindful that not all aircraft use the default transponder logic. You may have to write multiple different scripts for the INC/DEC action.

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

Example - using "MyXpdrDigit" as the LVar Name:

1. this would be the Advance/Toggle script:

(L:MyXpdrDigit)·++·s0·l0·3·>·if{·0·s0·}·l0·(>L:MyXpdrDigit)

2. and this is the INC script (with default simulator events! This doesn't have to work with every aircraft!)

(L:MyXpdrDigit)·s0·
l0·0·==·if{·1·(>K:XPNDR_1_INC)·}·
l0·1·==·if{·1·(>K:XPNDR_10_INC)·}·
l0·2·==·if{·1·(>K:XPNDR_100_INC)·}·
l0·3·==·if{·1·(>K:XPNDR_1000_INC)·}·

 

Edited by Lorby_SI

LORBY-SI

  • Author

Thanks a lot. The first script is not easy to understand but I think I got it, even if I'm unable to write it by myself

  • Commercial Member
1 hour ago, jlr1 said:

Thanks a lot. The first script is not easy to understand but I think I got it, even if I'm unable to write it by myself

Try this Reverse Polish Notation (flightsimulator.com)

And the AAO manual, chapter about "Scripting" - there are tables listing all operators and commands. There are more operators available in AAO than there are in the simulator SDK. Plus many custom commands that only exist in AAO in the first place. 

s0 and l0 are register operators. s0 stores the current value on the stack in register "0" and l0 reads that value. That way I don't have to type the full name of the LVar all the time.

LORBY-SI

Archived

This topic is now archived and is closed to further replies.

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.