January 6, 20242 yr 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 January 6, 20242 yr by Lorby_SI LORBY-SI
January 6, 20242 yr 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 January 6, 20242 yr by Lorby_SI LORBY-SI
January 6, 20242 yr 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 January 6, 20242 yr by Lorby_SI LORBY-SI
January 7, 20242 yr 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 Edited January 7, 20242 yr by Akila Joel Strikovsky
January 7, 20242 yr 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 January 7, 20242 yr by Lorby_SI LORBY-SI
January 7, 20242 yr 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 January 7, 20242 yr by Lorby_SI LORBY-SI
January 7, 20242 yr Author Haa, OK got ya. It works 🙂 You the best !!!! Edited January 7, 20242 yr by Akila Joel Strikovsky
Archived
This topic is now archived and is closed to further replies.