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.

Auto Brake Selector for PMDG with TCA - Struggle / Help

Featured Replies

  • Commercial Member
8 hours ago, Bob Scott said:

Does AAO have the ability to scan a joystick's current button state?

Yes, but the DirectInput library does only reveal the actual state when the controller has been used at least once. After the initial scan is complete AAO is working purely event-based - it handles the messages coming in from the DirectInput logic in Windows. If you wanted to, you could probably script this with the HID commands in AAO, but it doesn't have commands for querying a DirectInput device - there was no need for them.

You could use your LUA script though and trigger an action in AAO via the WebAPI or Winvar. Or install LUA in the Windows Script Host, you can use that in AAO as well (no guarantee though, only JScript and VBScript have been tested yet)

Edited by Lorby_SI

LORBY-SI

  • Replies 36
  • Views 5.8k
  • Created
  • Last Reply
  • Commercial Member
17 hours ago, Akila said:

As for the script, I am not sure even how to write one and use a script.

I did some more scripting, and I got it working perfectly fine for me. 

1. First, I activated the data collection from the PMDG SDK (see AAO manual, chapter about PMDG aircraft - the script "PMDG-PMDG_737MSFS_Data" has to be established as an Aircraft Automated Script, repeating, 100ms, and data transmission has to be activated in the aircraft's ini file)

2. Then I wrote two scripts:
First script:

Group: Scripts
Name: Force737Ab
Code: (L:Scripts-Force737Ab)·(>L:AutoBrakeSelected)


Second script:

Group: Scripts
Name: Auto737Ab
Code: (PMDG:MAIN_AutobrakeSelector)·(L:AutoBrakeSelected)·!=·if{·(L:AutoBrakeSelected)·(>K:#70092)·}

3. Then I assigned "Scripts-Force737Ab" as Key Down to each button, keeping the button value box as it was (1-5)

4. I assigned the same script to the Key Up event for button 21 only, like we did before. Value box at 0

5. Then I added "Scripts-Auto737Ab" as another Aircraft Automated Script to the 737, also Repeating, 100 ms

What this does is the following:

  • Each button action will set my LVar (L:AutoBrakeSelected) to the desired value. The autoscript will constantly check if the actual auto brake setting in the 737 is the same as my LVar, and if it isn't, then it will force that value using the #70092 event.
  • When set up like this,it doesn't matter at all how fast I turn the knob - the autoscript will pick up the desired value and force the selector in the cockpit to that position.

Edited by Lorby_SI

LORBY-SI

  • Commercial Member
17 hours ago, Bob Scott said:

Does AAO have the ability to scan a joystick's current button state? 

That is a good idea - I will add this to the scripting engine. Maybe two commands, one to force an update of all button positions on all devices, and a second one where you can read the actual state into an array for processing in RPN, JScript or VBScript.

Edited by Lorby_SI

LORBY-SI

  • Author

 

On 1/6/2024 at 7:49 PM, Lorby_SI said:

5. Then I added "Scripts-Auto737Ab" as another Aircraft Automated Script to the 737, also Repeating, 100 ms

I did not understand this step. assign it to what button?

 

 

On 1/6/2024 at 7:49 PM, Lorby_SI said:


Second script:


Group: Scripts
Name: Auto737Ab
Code: (PMDG:MAIN_AutobrakeSelector)·(L:AutoBrakeSelected)·!=·if{·(L:AutoBrakeSelected)·(>K:#70092)·}

 

I am unable to add this scrip I get an error

m36nhMO.png

Edited by Akila

Joel Strikovsky
Banner_FS2Crew_NGX_Driver.jpg

  • Commercial Member
22 minutes ago, Akila said:

I am unable to add this scrip I get an error

That is not how this works. These are three separate items:

"Group" is the "Script group" that you select (or create)
"Name" is the "Script Title" that you enter at the top. Only the "Auto737Ab", without the word "Name:" and without the quotes
"Code" is the RPN Code that goes into the big white box. Only the Code, without the word "Code:"

Edited by Lorby_SI

LORBY-SI

  • Commercial Member
16 minutes ago, Akila said:

I did not understand this step. assign it to what button?

Not to a button - this is added as an Aircraft Automated Script (see Menu "Scripting") It is supposed to run automatically in the background. 

Same as the "PMDG-PMDG_737MSFS_Data" Script.

Just click on the question mark in the title bar of the AAO main dialog. That will open the AAO manual. There is a chapter about scripting and another one specifically for PMDG aircraft.

Edited by Lorby_SI

LORBY-SI

  • Author

Haa, OK got ya.
It works 🙂

You the best !!!!

Edited by Akila

Joel Strikovsky
Banner_FS2Crew_NGX_Driver.jpg

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.