Hi
@SemlerPDX ,
...
The automatic obtaining of the landing permission is known. But the calling of the menus gets confused,
if one has called e.g. the TAB "Contacts", which is not always available. How to work around this problem.
And secondly, if the landing permission is forbidden, the next request could be made again after approx. 5 seconds.
I have not yet managed to do this without errors.
One pro tip for using VA and macros to control your UI Panels is to turn off 'look at panel' to display it - this way you can look anywhere without accidentally pulling up a UI panel, and this is essential to ensuring macros do not get out of sorts, and start pushing all sorts of buttons incorrectly because they started off on the wrong page/tab/etc. This can be very troublesome especially if you are in a hurry to avoid getting scanned with a cargo hold full of contraband.
Second, when it comes to these UI panels, since there is no "reset" and the UI will remain on a tab/page it was last set to, I force all my UI macros to start from (and return to) the first panel. So, if the action is to open the left panel, move over a couple tabs, and press a button on the panel, the next steps are to move back the same number of tabs and close the panel.
I put most everything I can into "config" commands or files, these are where my global variables are set, and get read each time the profile is loaded. I use a variable pause for the time between keypresses and the time a key is held down, so they can be fine tuned in one location for all commands with keypresses, so this may look odd - also is old, probably needs some tweaking as I begin to recreate my systems in my new AVCS CORE Framework profile family for VoiceAttack.
The idea is to always return menus to where they started, so the next Macro can do it's thing properly. When I must manually navigate menus, I always return them to the first/leftmost panel and close them, so they are ready for any voice macro menu actions. I also set a boolean called "AVCS_Macros_ON", and in other sensitive commands, check if this is true before attempting to fire another macro so that two can never operate at the same time (the script below is a separate command 'called' by my voice command for Request Docking, where that check occurs):
Code:
//Dynamic Keypress Macro - Request Docking
// ***This Script expects the Left Panel to be resting on the leftmost Navigation Panel and closed***
// by SemlerPDX Jan2019
// VETERANS-GAMING.COM
//
Set Boolean [AVCS_Macros_ON] to True
Press down variable key(s) [edFocusLeftPanel]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edFocusLeftPanel]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
//
Press down variable key(s) [edCycleNextPanel]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edCycleNextPanel]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
Press down variable key(s) [edCycleNextPanel]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edCycleNextPanel]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
//
Press down variable key(s) [edUI_Right]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edUI_Right]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
Press down variable key(s) [edUI_Select]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edUI_Select]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
//
Press down variable key(s) [edCyclePreviousPanel]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edCyclePreviousPanel]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
Press down variable key(s) [edCyclePreviousPanel]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edCyclePreviousPanel]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
//
Press down variable key(s) [edUI_Back]
Pause a variable number of seconds [AVCS_QCC_TimeHeldDown]
Release variable key(s) [edUI_Back]
Pause a variable number of seconds [AVCS_QCC_TimeBetween]
Set Boolean [AVCS_Macros_ON] to False
Best wishes and good luck!
Personally, when I use my macro to request docking and it is denied, I manually wait for 5 seconds and issue the voice command again - since my first macro returns to leftmost panel anyway, it is already reset and ready to fire again as needed - this is something I would not prefer to have on an automated system for detecting that it was denied and auto-refire at 5 second mark cuz computers are stupid and need supervision; can't account for every scenario so easily
As far as the appearance of a panel that is not always there (contacts), then it is most important for you as the user to know when this macro is safe to call. It will always be there when you are within range of a docking station IIRC, so is a non-issue there.
EDIT: Also wanted to note that, as opposed to doing checks each time during a macro command, you can use all sorts of Event Triggers to set some booleans/variables as to the state of things, and just check those variables as needed to ensure your commands "can" fire, or everything is in the correct state to fire (as bronney's example shows, where he checks for deployed fighter, target lock, etc.)
These are the triggers I currently use (well, used, as noted haven't worked on this profile since 2019):
Hello sir. This is my "Contacts", it uses [Status vehicle] to check whether you're in a fighter (where Navigation is unavailable), and [Status gui focus] to see if you are already looking at that panel to move tabs instead of opening and closing again. Then custom var to track which tab you're in. Also had to check whether you have a target locked, which would make the number of tabs different.
That's some excellent problem solving there, accounting for the curve balls that can get thrown around. If I might offer some constructive criticism, the actions to execute another command in order to push buttons such as 'Tab Previous' or such has a timing hit to be considered compared to simply pressing the correct key at that stage, and since this is a macro, and there are many of them, they all add up and complicate any optimization and fine control of the speed. You can set variables to hold the key to press, and they can be called whatever you want (even 'Tab Previous'), or if this is for public distribution, you might consider using some version of the plugin 'bindED' which presents you with callbacks which correlate to whatever the user has saved in their Controls in Elite Dangerous.
One of the coolest things about macros is that they can input keystrokes like Commander Data from Star Trek, so long as we know the 'fastest' that our computer can accept those inputs (usually no faster than 0.05 seconds button push, and time between button pushes), and by taking full control over these things, you can ensure your macros are firing (and delaying) only at your set intervals, and as fast as physically possible on your PC.