May 30, 20251 yr I'm trying to understand how to do some things using the Stream Deck AAO plugin. Specifically, use an event or a switch, to both assign a value to a variable then execute a script statement, or to assign a value to a variable depending on the current state of the variable. I'm guessing what the plugin does, under the hood as it were, is to compile a script statement in the form: x (> y:variable) using the value in the value box for x, the value in the variable box for the variable and the value in the drop down box to select the variable type y. So, if that is correct, can I put any script items I want in the variable box as long as the first bit is just the name of the variable? Sorry if that's not clear!
May 30, 20251 yr Author Just now, kevinbuckley70 said: I'm trying to understand how to do some things using the Stream Deck AAO plugin. Specifically, use an event or a switch, to both assign a value to a variable then execute a script statement, or to assign a value to a variable depending on the current state of the variable. I'm guessing what the plugin does, under the hood as it were, is to compile a script statement in the form: x (> y:variable) using the value in the value box for x, the value in the variable box for the variable and the value in the drop down box to select the variable type y. So, if that is correct, can I put any script items I want in the variable box as long as the first bit is just the name of the variable? Sorry if that's not clear! As a follow up, is there a way to have three or more button images on the Stream Deck to show how a multiposition selector switch is currently set?
May 30, 20251 yr Commercial Member In the ZIP there should be a PDF that explains the plugins' Action types? The best way to start is to dowload one of the 'professional' SD profiles from flightsim.to and analyze how the authors are doing it. There are also icon packs etc. available on that site, made by other talented simmers. Your use case with multiple images would typically be implemented as a SliderGauge or MultiGauge Action. Edited May 30, 20251 yr by Lorby_SI LORBY-SI
May 31, 20251 yr Author On 5/30/2025 at 4:13 PM, Lorby_SI said: In the ZIP there should be a PDF that explains the plugins' Action types? The best way to start is to dowload one of the 'professional' SD profiles from flightsim.to and analyze how the authors are doing it. There are also icon packs etc. available on that site, made by other talented simmers. Your use case with multiple images would typically be implemented as a SliderGauge or MultiGauge Action. Thanks for the quick response. MultiGauge is the correct button type. I've looked at various 'professional' profiles but it has not helped me with my action. Basically, I want a single SD button to toggle through the various values of the C310R fuel selector with each press (actually one button for the left selector and one for the right selector). I can get the button image to change as I manually change the selector in the cockpit. The selector variable has the following values: 0-other tank, 1-main, 2-aux, 3-off. So I assume somewhere in the button definitions I can enter a formula to do this, which reads the current value and then conditionally sends a new value. Such as: (L:C310_SW_FUEL_SEL_LEFT,·enum)·2·!=·if{·2·(>L:C310_SW_FUEL_SEL_LEFT,·enum)·}·els{1·(>L:C310_SW_FUEL_SEL_LEFT,·enum)} This is a switch I have on my quadrant which toggles between main and aux. So my question is: in the SD MultiGauge button setup - would I put that formula in the key down variable box? Or the event value box? Or, do I just put the variable C310_SW_FUEL_SEL_LEFT in the variable box, choose L: from the side dropdown, then put something like this in the event value box: (L:C310_SW_FUEL_SEL_LEFT,·enum)·2·!=·if{·2·}·els{1·} I couldn't get that to work by the way. But maybe I got the syntax slightly wrong. Or maybe the sim times out by the time I finished entering it (which happens sometimes) or, or, or... There are many reasons why it might not have worked. Maybe just down to a small typo, or I put the wrong thing into the wrong box. It would be good to know if I am on the right track with this. My intention is then to use long press to cycle backwards through the four settings. Any help very much appreciated!
May 31, 20251 yr Commercial Member 30 minutes ago, kevinbuckley70 said: So my question is: in the SD MultiGauge button setup - would I put that formula in the key down variable box? Or the event value box? Or, do I just put the variable C310_SW_FUEL_SEL_LEFT in the variable box, choose L: from the side dropdown, then put something like this in the event value box: (L:C310_SW_FUEL_SEL_LEFT,·enum)·2·!=·if{·2·}·els{1·} Sorry, but it is none of that. There must be dozens of examples in the existing profiles for Actions like this one. Make sure to read through the PDF and the AAO manual, chapter Scripting. Personally, I wouldn't use a MultiGauge, but a Slider. Less complexity, better performance. Write the script in the AAO Script Editor and make sure that it is actually working there using the "Test" button. Then save it to the AAO database and call it from the StreamDeck Action using the K: "scriptgroup-scripttitle" syntax with a value of "0" (value doesn't matter in this case, it just can't be empty). For what you want to do you will need a script using the seq or iseq operators. Something like this: 0 1 2 3 2 1 (L:C310_SW_FUEL_SEL_LEFT, Enum) (L:C310LFuel) 6 iseq (>L:C310_SW_FUEL_SEL_LEFT, Enum) (>L:C310LFuel) For the image on the SliderGauge Action you simply glue together pictures of all states of that knob into a single strip, in the correct sequence. Then use the LVar (L:C310_SW_FUEL_SEL_LEFT, enum) as value variable to position the image as required. (for completeness sakes: instead of calling a stored script from AAO as K: you can also paste the entire code into the event box and use type S: to execute it. Value is still 0.) Edited May 31, 20251 yr by Lorby_SI LORBY-SI
May 31, 20251 yr Author 2 minutes ago, Lorby_SI said: Sorry, but it is none of that. There must be dozens of examples in the existing profiles for Actions like this one. Make sure to read through the PDF and the AAO manual, chapter Scripting. Personally, I wouldn't use a MultiGauge, but a Slider. Less complexity, better performance. Write the script in the AAO Script Editor and make sure that it is actually working there using the "Test" button. Then save it to the AAO database and call it from the StreamDeck Action using the K: "scriptgroup-scripttitle" syntax with a value of "0" (value doesn't matter in this case, it just can't be empty). For what you want to do you will need a script using the seq or iseq operators. Something like this: 0 1 2 3 2 1 (L:C310_SW_FUEL_SEL_LEFT, Enum) (L:C310Fuel) 6 iseq (>L:C310_SW_FUEL_SEL_LEFT, Enum) (>L:C310Fuel) For the image on the SliderGauge Action you simply glue together pictures of all states of that knob into a single strip, in the correct sequence. Then use the LVar (L:C310_SW_FUEL_SEL_LEFT, enum) as value variable to position the image as required. (for completeness sakes: instead of calling a stored script from AAO as K: you can also paste the entire code into the event box and use type S: to execute it. Value is still 0. OK thanks. I'll look at that. Just for my curiosity, can you put a script formula in the event value box? Or must it just be a number?
May 31, 20251 yr Commercial Member 3 minutes ago, kevinbuckley70 said: OK thanks. I'll look at that. Just for my curiosity, can you put a script formula in the event value box? Or must it just be a number? The value is just a number. For more complex tasks call stored scripts as "K:" or use "S:" The Elgato software isn't really well suited for writing complex scripts. The controls are too small and too awkward to handle. Use the AAO Script Editor instead to develop and test. Edit: when starting out, you need a quick win - start with a simple text gauge. Same code for the button press, but instead of fiddling with images, just display the LVar. Then you can see if everything is working as intended and then start creating the images for a Slider or Multi. Edited May 31, 20251 yr by Lorby_SI LORBY-SI
May 31, 20251 yr Author Looking at this. I'm guessing that I can't have a different script call depending on whether it is a short press or a long press? I was hoping to use 'short press' to cycle one way, and 'long press' to cycle back. Is the autoscript called on key up or key down?
May 31, 20251 yr Commercial Member 2 minutes ago, kevinbuckley70 said: Looking at this. I'm guessing that I can't have a different script call depending on whether it is a short press or a long press? I was hoping to use 'short press' to cycle one way, and 'long press' to cycle back. Is the autoscript called on key up or key down? Of course you can have different calls on short and long press. Doesn't make a lot of sense otherwise. The autoscript does not come into play here, why are you looking at that? It isn't called by neither key up or down, it just "is" - a script that is called every couple of milliseconds automatically. You only add an autoscript when you acutally need one - and you don't. LORBY-SI
Create an account or sign in to comment