ctytler Posted January 6, 2022 Author Share Posted January 6, 2022 Re: WinWing and DCS-ExportScript I'm aware that these don't play nice with each other. I had tried digging in a bit in the past, but had not any luck in finding the issue (with Winwing scripts or some other scripts that also have conflicts). It's also unfortunate that the "Fix Lua" button just deletes everything else in the file when I last tried it. I have been working on integrating DCS-BIOS as a backend replacement over the last couple months. And I believe this works alongside Winwing scripts, but I should re-verify that. So from my perspective, I'll keep pursuing integration there as a more complete fix. However I have been learning the React/Typescript languages along the way to create a better UI since it needed to change anyways (BIOS has more complicated concepts for input/output which is why I didn't originally pursue it, but it seems to be the best maintained option now). So that is taking a lot of time and effort to build up, but should make it scalable to more features going forward. Progress is being tracked here: https://github.com/charlestytler/streamdeck-dcs-interface/issues/41, and I can try get an alpha version uploaded in a few weeks so you can at least get core UFC functionality working (although with a perhaps clunky configuration process). Link to comment Share on other sites More sharing options...
Chewmann Posted January 6, 2022 Share Posted January 6, 2022 (edited) @ctytler I just joined github (I know...where have I been?). I posted on your thread that I am willing to be a beta tester for you. I am following the thread as well, so I will keep an eye on it too. Thanks for all the TREMENDOUS work, effort, and time you have put towards this. It truly makes my DCS experience soooo much better. Plus you are driving me to develop coding skills Edited January 6, 2022 by Chewmann 1 Link to comment Share on other sites More sharing options...
MrBlessyolife Posted January 7, 2022 Share Posted January 7, 2022 First of all, awesome work to everyone in this thread. I'm looking for some guidance to increase my general knowledge between the lua, and the plugin. For example, I'm trying to display fuel quantity in the f5. In the lua I see this: -- Fuel Quantity Indicator (Dual) [22] = "%.4f", -- FuelQuantity_Left {0.0, 1.0} {0.0, 2500.0} [23] = "%.4f", -- FuelQuantity_Right {0.0, 1.0} {0.0, 2500.0} I put "22" in the ID and on the stream deck it displays "0.7878" and every attempt at mine change the display string gives me nothing. I know I am doing something wrong so any help would be appreciated. Link to comment Share on other sites More sharing options...
bones1014 Posted January 7, 2022 Share Posted January 7, 2022 2 minutes ago, MrBlessyolife said: First of all, awesome work to everyone in this thread. I'm looking for some guidance to increase my general knowledge between the lua, and the plugin. For example, I'm trying to display fuel quantity in the f5. In the lua I see this: -- Fuel Quantity Indicator (Dual) [22] = "%.4f", -- FuelQuantity_Left {0.0, 1.0} {0.0, 2500.0} [23] = "%.4f", -- FuelQuantity_Right {0.0, 1.0} {0.0, 2500.0} I put "22" in the ID and on the stream deck it displays "0.7878" and every attempt at mine change the display string gives me nothing. I know I am doing something wrong so any help would be appreciated. You'd have to do some math to convert it into numbers for a proper display. or you can go nuts in the text change section like this for the gun counter on the Mi-8: 0.9000=18,0.8500=17,0.8000=16,0.7500=14,0.7000=13,0.6500=13,0.6000=12,0.5500=11,0.5000=10,0.4500=9,0.4000=8,0.3500=7,0.3000=6,0.2500=5,0.2000=4,0.1500=3,0.1000=2,0.0500=1,0.0000=0 Link to comment Share on other sites More sharing options...
MrBlessyolife Posted January 7, 2022 Share Posted January 7, 2022 25 minutes ago, bones1014 said: You'd have to do some math to convert it into numbers for a proper display. or you can go nuts in the text change section like this for the gun counter on the Mi-8: 0.9000=18,0.8500=17,0.8000=16,0.7500=14,0.7000=13,0.6500=13,0.6000=12,0.5500=11,0.5000=10,0.4500=9,0.4000=8,0.3500=7,0.3000=6,0.2500=5,0.2000=4,0.1500=3,0.1000=2,0.0500=1,0.0000=0 Okay, I think I understand. I'll fiddle with it some more, thank you for the quick response. Link to comment Share on other sites More sharing options...
bones1014 Posted January 8, 2022 Share Posted January 8, 2022 1 hour ago, MrBlessyolife said: Okay, I think I understand. I'll fiddle with it some more, thank you for the quick response. There's probably an easier way to do it with lua code but I'm not the one to ask about that. There are other guys here that are really good with it. Link to comment Share on other sites More sharing options...
Bailey Posted January 8, 2022 Share Posted January 8, 2022 (edited) 5 hours ago, MrBlessyolife said: Okay, I think I understand. I'll fiddle with it some more, thank you for the quick response. Here is what I would do. Head over to the moduleViewer and load in the F-5 Cockpit via Mods/aircraft/F-5E/Cockpit/Shapes/Cockpit_F-5E.EDM. Open the Args dropdown and find [22]. Adjust the screen so that you are looking at the fuel guage and start adjusting the 22 value to see what it looks like. Lucky for us, you should notice that it adjusts from 0 to 2,500 lbs of fuel in a linear fashion. Now we know that in the lua we can simply multiply the output by some number to get the indicated fuel. That number is....2,500 ! Quick mental math check, if the fuel guage is half way, the arg should indicate 0.50 and the value on the guage should be half of 2,500, which would be 1,250. Ok, we already said that our magic multiple is 2,500 so our equation is [22] * 2,500 = resultFuel 0.50 * 2,500 = resultFuel 0.50 * 2,500 = 1,250 Correct! The first equation will be the math you will use in the lua. (We will adjust it to read as lua code later). Now we open the F5 lua, Ctrl+F "fuel" and...oh my... someone already did it for us! Check around line 646 if you have the lua from the Library (). -- Fuel Quantity Indicator (Dual) local lLeftFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(22) * 2500, 0) local lRightFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(23) * 2500, 0) ExportScript.Tools.SendDataDAC(2003, lLeftFuel) ExportScript.Tools.SendDataDAC(2004, lRightFuel) ExportScript.Tools.SendDataDAC(2005, lLeftFuel + lRightFuel) *It's just in the wrong place for DCS-Interface to see it and changes need to be made.* Copy and paste it to the end of the `function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)` function, but before where it says "end". For me that's about line 615. Change the "SendDataDAC" to "SendData". Change the export numbers to 2006, 2007, and 2008 (or whatever is available). Save, launch DCS, and do as you did before but instead of putting 22 put 2006, 2007, or 2008. I am loading into DCS F-5 Instant Action Takeoff now and.....voila! whoops, I forgot to replace the two other "SendDataDAC" with "SendData"... Just gonna edit that real quick, save the lua, and in DCS press RShift+R to restart the mission, and...viola! There they are! I hope this helps answer the question as well as explain the process I use to get some of those values exported into useful information. (Yes, this was a live performance ) Edited January 8, 2022 by Bailey DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
MrBlessyolife Posted January 8, 2022 Share Posted January 8, 2022 (edited) 3 hours ago, Bailey said: Here is what I would do. Head over to the moduleViewer and load in the F-5 Cockpit via Mods/aircraft/F-5E/Cockpit/Shapes/Cockpit_F-5E.EDM. Open the Args dropdown and find [22]. Adjust the screen so that you are looking at the fuel guage and start adjusting the 22 value to see what it looks like. Lucky for us, you should notice that it adjusts from 0 to 2,500 lbs of fuel in a linear fashion. Now we know that in the lua we can simply multiply the output by some number to get the indicated fuel. That number is....2,500 ! Quick mental math check, if the fuel guage is half way, the arg should indicate 0.50 and the value on the guage should be half of 2,500, which would be 1,250. Ok, we already said that our magic multiple is 2,500 so our equation is [22] * 2,500 = resultFuel 0.50 * 2,500 = resultFuel 0.50 * 2,500 = 1,250 Correct! The first equation will be the math you will use in the lua. (We will adjust it to read as lua code later). Now we open the F5 lua, Ctrl+F "fuel" and...oh my... someone already did it for us! Check around line 646 if you have the lua from the Library (). -- Fuel Quantity Indicator (Dual) local lLeftFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(22) * 2500, 0) local lRightFuel = ExportScript.Tools.round(mainPanelDevice:get_argument_value(23) * 2500, 0) ExportScript.Tools.SendDataDAC(2003, lLeftFuel) ExportScript.Tools.SendDataDAC(2004, lRightFuel) ExportScript.Tools.SendDataDAC(2005, lLeftFuel + lRightFuel) *It's just in the wrong place for DCS-Interface to see it and changes need to be made.* Copy and paste it to the end of the `function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)` function, but before where it says "end". For me that's about line 615. Change the "SendDataDAC" to "SendData". Change the export numbers to 2006, 2007, and 2008 (or whatever is available). Save, launch DCS, and do as you did before but instead of putting 22 put 2006, 2007, or 2008. I am loading into DCS F-5 Instant Action Takeoff now and.....voila! whoops, I forgot to replace the two other "SendDataDAC" with "SendData"... Just gonna edit that real quick, save the lua, and in DCS press RShift+R to restart the mission, and...viola! There they are! I hope this helps answer the question as well as explain the process I use to get some of those values exported into useful information. (Yes, this was a live performance ) WOW! That was it. Thanks a bunch! First of all, I didn't even know the model viewer even existed, also I saw that bit that was at line 646, but I didn't really know what it meant/ or even what to do with it. Would I use a similar process for any gauge in any module? Second question, if I wanted to add something like "lbs, °C, km/h, etc" to the end of what's displayed on the stream deck how would I do that/ is it possible? Edit: One more question, let's say I want to stack the three values on one tile, for example the Left, Right, and total fuel? Again, thank you a bunch, that was very helpful. Edited January 8, 2022 by MrBlessyolife Added question Link to comment Share on other sites More sharing options...
bones1014 Posted January 8, 2022 Share Posted January 8, 2022 (edited) The F-14 has a speed brake indicator that is broken into two items. I'm trying to get it exported info one. I tried writing a script in the lua but it just causes the export script to stop working. I also tried using text values for the test like - speedbrake_indicator = "extended". Any ideas? I placed the ExportScript.SpeedBrakeIndicator(mainPanelDevice) in the function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_indicator --check if speedbrake partially extended if mainPanelDevice:get_argument_value(8307) = 1.0 then speedbrake_indicator = 1 --check if speedbrake fully extended elseif mainPanelDevice:get_argument_value(8308) = 1.0 then speedbrake_indicator = 2 --check if speedbrake fully retracted elseif mainPanelDevice:get_argument_value(8307) = 0.0 and mainPanelDevice:get_argument_value(8308) = 0.0 then speedbrake_indicator = 0 end ExportScript.Tools.SendData(53025, speedbrake_indicator) end Edited January 8, 2022 by bones1014 Link to comment Share on other sites More sharing options...
bones1014 Posted January 8, 2022 Share Posted January 8, 2022 (edited) I can get this to work but as soon as I try to add the if/the/else/elseif it crashes the whole export function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local indicator indicator = "happy" ExportScript.Tools.SendData(53025, indicator) end If I try to do any kind of a logical test the script fails. I'm trying this now function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) if speedbrake_partial > 0 then speedbrake_indicator = "partial" ExportScript.Tools.SendData(53025, speedbrake_indicator) end This works function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) speedbrake_indicator = speedbrake_partial ExportScript.Tools.SendData(53025, speedbrake_indicator) end Edited January 8, 2022 by bones1014 added more code Link to comment Share on other sites More sharing options...
Bailey Posted January 8, 2022 Share Posted January 8, 2022 46 minutes ago, bones1014 said: I can get this to work but as soon as I try to add the if/the/else/elseif it crashes the whole export function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local indicator indicator = "happy" ExportScript.Tools.SendData(53025, indicator) end If I try to do any kind of a logical test the script fails. I'm trying this now function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) if speedbrake_partial > 0 then speedbrake_indicator = "partial" ExportScript.Tools.SendData(53025, speedbrake_indicator) end This works function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) speedbrake_indicator = speedbrake_partial ExportScript.Tools.SendData(53025, speedbrake_indicator) end I havent tried your code, but you are missing and "end" after the end of the "if". Random example: if string.len(minutes) < 2 then minutes = "0" .. minutes end Let me know how that works out for ya. DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
Bailey Posted January 8, 2022 Share Posted January 8, 2022 8 hours ago, MrBlessyolife said: WOW! That was it. Thanks a bunch! First of all, I didn't even know the model viewer even existed, also I saw that bit that was at line 646, but I didn't really know what it meant/ or even what to do with it. Would I use a similar process for any gauge in any module? Second question, if I wanted to add something like "lbs, °C, km/h, etc" to the end of what's displayed on the stream deck how would I do that/ is it possible? Edit: One more question, let's say I want to stack the three values on one tile, for example the Left, Right, and total fuel? Again, thank you a bunch, that was very helpful. I am glad my walkthrough helped. Take a look at arround line 1398 of the F16 lua file in the Library. You should see this: ExportScript.Tools.SendData(3000, "OTHER1\n" .. CMDS_O1_Amount) ExportScript.Tools.SendData(3001, "OTHER2\n" .. CMDS_O2_Amount) ExportScript.Tools.SendData(3002, "CHAFF\n" .. CMDS_CH_Amount) ExportScript.Tools.SendData(3003, "FLARE\n" .. CMDS_FL_Amount) ExportScript.Tools.SendData(3004, "CH " .. CMDS_CH_Amount .. "\nFL " .. CMDS_FL_Amount) ExportScript.Tools.SendData(3005, "O1 " .. CMDS_O1_Amount .. "\nO2 " .. CMDS_O2_Amount .. "\nCH " .. CMDS_CH_Amount .. "\nFL " .. CMDS_FL_Amount) I'll show you what the output will look like on some of these: (3000) OTHER1 -- (3002) CHAFF 60 (3004) CH 60 FL 60 See the pattern yet? A pair of quote defines a string. The lack of a pair of quotes says that it's a variable that was previously defined. The \n is how you do a NEWLINE, similar to pressing ENTER on the keyboard. A pair of dots ties string groups and variables together. (Or even variables to other variables for special cases.) This is how you make the export say different things. Give it a try. DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
bones1014 Posted January 8, 2022 Share Posted January 8, 2022 (edited) 19 minutes ago, Bailey said: I havent tried your code, but you are missing and "end" after the end of the "if". Random example: if string.len(minutes) < 2 then minutes = "0" .. minutes end Let me know how that works out for ya. Oh I didn't know that each if needed an end behind it! I'll add that. *update* I'm not getting the value to display but at least the whole script isn't crashing. Edited January 8, 2022 by bones1014 Link to comment Share on other sites More sharing options...
bones1014 Posted January 8, 2022 Share Posted January 8, 2022 Got it! Maybe not the most elegant way to do it. I'd like to do just a straight if/then/else test of numbers but my syntax is wrong because it breaks. It will work if I test it against a text string. function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) -- partial extension in x.x format number local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) -- full extension in x.x format number local speedbrake_indicator --exported value --test if speed brake is extended partially if speedbrake_partial == "1.0" then speedbrake_indicator = "1" --test if speed brake is extended fully elseif speedbrake_extended == "1.0" then speedbrake_indicator = "2" --test if speedbrake is retracted elseif speedbrake_partial == "0.0" and speedbrake_extended == "0.0" then speedbrake_indicator = "0" end ExportScript.Tools.SendData(53025, speedbrake_indicator) end Link to comment Share on other sites More sharing options...
MrBlessyolife Posted January 8, 2022 Share Posted January 8, 2022 (edited) 3 hours ago, Bailey said: I am glad my walkthrough helped. Take a look at arround line 1398 of the F16 lua file in the Library. You should see this: ExportScript.Tools.SendData(3000, "OTHER1\n" .. CMDS_O1_Amount) ExportScript.Tools.SendData(3001, "OTHER2\n" .. CMDS_O2_Amount) ExportScript.Tools.SendData(3002, "CHAFF\n" .. CMDS_CH_Amount) ExportScript.Tools.SendData(3003, "FLARE\n" .. CMDS_FL_Amount) ExportScript.Tools.SendData(3004, "CH " .. CMDS_CH_Amount .. "\nFL " .. CMDS_FL_Amount) ExportScript.Tools.SendData(3005, "O1 " .. CMDS_O1_Amount .. "\nO2 " .. CMDS_O2_Amount .. "\nCH " .. CMDS_CH_Amount .. "\nFL " .. CMDS_FL_Amount) I'll show you what the output will look like on some of these: (3000) OTHER1 -- (3002) CHAFF 60 (3004) CH 60 FL 60 See the pattern yet? A pair of quote defines a string. The lack of a pair of quotes says that it's a variable that was previously defined. The \n is how you do a NEWLINE, similar to pressing ENTER on the keyboard. A pair of dots ties string groups and variables together. (Or even variables to other variables for special cases.) This is how you make the export say different things. Give it a try. Worked great! Thank you, that was very helpful. It took me a few tries but now I understand. Edit: Update I was also able to make chaff and flare counters on the F-5 and also put them on one tile, thanks again that was very informative and helped me a ton. Edited January 8, 2022 by MrBlessyolife Update 1 Link to comment Share on other sites More sharing options...
lassekongo Posted January 9, 2022 Share Posted January 9, 2022 On 1/4/2022 at 1:27 AM, Bailey said: I have attached the working profile and lua. Specifically for the F16 ECM panel, pay attention to line 694 and lines 1047-1321 in the lua. I'll update the Wiki later. The BIT button is there for testing. Tap the ECM button once to turn it on. Double tap it to turn the button off... Oh, and before I forget, I can't get the ECM buttons to work nicely via a DCS Interface Switch Input button. Here is my setup for ECM 1. A press will enable it and a double press is required to disable it, which seems odd. Any ideas why and/or a solution? The ExportScripts Library has been updated with the files mentioned above: https://github.com/asherao/DCS-ExportScripts https://github.com/asherao/DCS-ExportScripts/wiki/F-16C I did exactly as you instructed and read the posts but for some reason my buttons dont switch letters and colours as yours does it only stays in solid image state. Have used exactly same lua Link to comment Share on other sites More sharing options...
Bailey Posted January 9, 2022 Share Posted January 9, 2022 1 hour ago, lassekongo said: I did exactly as you instructed and read the posts but for some reason my buttons dont switch letters and colours as yours does it only stays in solid image state. Have used exactly same lua Please attach the lua you are using. DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
Bailey Posted January 9, 2022 Share Posted January 9, 2022 (edited) 13 hours ago, bones1014 said: Got it! Maybe not the most elegant way to do it. I'd like to do just a straight if/then/else test of numbers but my syntax is wrong because it breaks. It will work if I test it against a text string. function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) -- partial extension in x.x format number local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) -- full extension in x.x format number local speedbrake_indicator --exported value --test if speed brake is extended partially if speedbrake_partial == "1.0" then speedbrake_indicator = "1" --test if speed brake is extended fully elseif speedbrake_extended == "1.0" then speedbrake_indicator = "2" --test if speedbrake is retracted elseif speedbrake_partial == "0.0" and speedbrake_extended == "0.0" then speedbrake_indicator = "0" end ExportScript.Tools.SendData(53025, speedbrake_indicator) end TLDR: Scroll down for the code. I think about the logic as it makes sense to me. Firstly, if I look at the speedbrake indicator and see the word "IN", I would expect the speedbrakes to be "in". Now that I have established that mentally, what determines the speedbrake showing "IN"? These values are what I observed playing with the two args in the modelViewer. We know that when arg[8307] AND arg[8308] are both 0, we see "IN". We know that when arg[8307] is 1 AND arg[8308] is 0, we see the holes, which means Partially Extended. We know that when arg[8308] is 1, we see the black flag, which means Fully Extended. Here is how it looks in lua: Spoiler local speedbrake_indicator --exported value if mainPanelDevice:get_argument_value(8307) < 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = "Retracted" elseif mainPanelDevice:get_argument_value(8307) > 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = "Partial Ext" elseif mainPanelDevice:get_argument_value(8308) > 0.5 then speedbrake_indicator = "Full Ext" end You can see that I used "more and less than" instead of 1 or 0. That's because 1 and 0 are very precise and sometimes the animations give a fit. Sometimes they don't. In this case it is ok for us to use "more and less than 0.5" because the animations should not stop on anything other than 1 or 0. I hope that makes sense. Also notice that I named things plainly and in a way that is readable, especially the exported values. This helps in the event that you have to go pack and adjust something. Remember, a value in "quotes" is a string. Jumping in-game we see that it works. Now we can rewrite it into data that other apps or functions can use. function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_indicator --exported value if mainPanelDevice:get_argument_value(8307) < 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = 0 elseif mainPanelDevice:get_argument_value(8307) > 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = 1 elseif mainPanelDevice:get_argument_value(8308) > 0.5 then speedbrake_indicator = 2 end ExportScript.Tools.SendData(53025, speedbrake_indicator) end And there you go. Put `ExportScript.SpeedBrakeIndicator(mainPanelDevice)` in your preferred refresh rate and you now have the base for a speedbrake indicator for the F14. With more time you can write an even more accurate indicator, but I think this gets the intention across and is quite usable. Thank you for this. I'll put it in the Library when I have the chance. Edited January 9, 2022 by Bailey DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
bones1014 Posted January 9, 2022 Share Posted January 9, 2022 5 hours ago, Bailey said: function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_indicator --exported value if mainPanelDevice:get_argument_value(8307) < 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = 0 elseif mainPanelDevice:get_argument_value(8307) > 0.5 and mainPanelDevice:get_argument_value(8308) < 0.5 then speedbrake_indicator = 1 elseif mainPanelDevice:get_argument_value(8308) > 0.5 then speedbrake_indicator = 2 end ExportScript.Tools.SendData(53025, speedbrake_indicator) end And there you go. Put `ExportScript.SpeedBrakeIndicator(mainPanelDevice)` in your preferred refresh rate and you now have the base for a speedbrake indicator for the F14. With more time you can write an even more accurate indicator, but I think this gets the intention across and is quite usable. Thank you for this. I'll put it in the Library when I have the chance. I dunno what I did but my first try was doing exactly what you posted at the end and I couldn't get it to work. That's why I was using text strings and equals instead of greater/less than because yes using greater/less than makes more sense to me. Thanks for cleaning it up. Link to comment Share on other sites More sharing options...
bones1014 Posted January 9, 2022 Share Posted January 9, 2022 (edited) I quick wrote this for the F-14 landing gear indicators. Seems to work so far through normal operation. function ExportScript.LandingGearIndicator(mainPanelDevice) --export all landing gear indicators local nose_gear local left_main local right_main --nose_gear 8300 = flag, 8301 = indicator if mainPanelDevice:get_argument_value(8300) < 0.5 and mainPanelDevice:get_argument_value(8301) > 0.5 then nose_gear = 1 --gear down elseif mainPanelDevice:get_argument_value(8300) > 0.5 then nose_gear = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8300) < 0.5 and mainPanelDevice:get_argument_value(8301) < 0.5 then nose_gear = 0 --gear up end --left_main 8303 = flag, 8302 = indicator if mainPanelDevice:get_argument_value(8303) < 0.5 and mainPanelDevice:get_argument_value(8302) > 0.5 then left_main = 1 --gear down elseif mainPanelDevice:get_argument_value(8303) > 0.5 then left_main = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8303) < 0.5 and mainPanelDevice:get_argument_value(8302) < 0.5 then left_main = 0 --gear up end --right_main 8304 = flag, 8305 = indicator if mainPanelDevice:get_argument_value(8304) < 0.5 and mainPanelDevice:get_argument_value(8305) > 0.5 then right_main = 1 --gear down elseif mainPanelDevice:get_argument_value(8304) > 0.5 then right_main = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8304) < 0.5 and mainPanelDevice:get_argument_value(8305) < 0.5 then right_main = 0 --gear up end ExportScript.Tools.SendData(53026, nose_gear) ExportScript.Tools.SendData(53027, left_main) ExportScript.Tools.SendData(53028, right_main) end Edited January 9, 2022 by bones1014 1 Link to comment Share on other sites More sharing options...
bones1014 Posted January 9, 2022 Share Posted January 9, 2022 is there a good way to display three states on these buttons? Link to comment Share on other sites More sharing options...
lassekongo Posted January 9, 2022 Share Posted January 9, 2022 12 hours ago, Bailey said: Please attach the lua you are using. So a little update. As I was going to post the lua i noticed that the luas in the lib folder and the config.lua along with exportscript lua. were all old (probably downloaded from sda export scripts github) and before i posted the lua I thought hey maybe changing these luas to your new one might help . So i was pretty happily surprised that now the F16 exportmodule lua and its switches lamps (especially the awsome ecm button work you have done) are all working. This is why I think Charlie tytler should link to your github instead of sda exportscript github as those luas there are old and have probably caused issues for more then me . Btw you bailey and charlie tytler are so awesome and i am really grateful and happy for the wonderful work you both have done 1 Link to comment Share on other sites More sharing options...
Chewmann Posted January 10, 2022 Share Posted January 10, 2022 (edited) I've been looking to expand my SD XL to display fuel weights and current trim settings (one of the most difficult things for me to get a hang of, let me tell you). I searched through the hornet lua and I don't see anything for fuel weight. Is this something I can get through the lua? Edited January 10, 2022 by Chewmann Link to comment Share on other sites More sharing options...
Bailey Posted January 10, 2022 Share Posted January 10, 2022 1 hour ago, Chewmann said: I've been looking to expand my SD XL to display fuel weights and current trim settings (one of the most difficult thing for to get a hang of, let me tell you). I searched through the hornet lua and I don't see anything for fuel weight. Is this something I can get through the lua? Short answer for trim setting is "not really". The trim amount in the fly-by-wire aircraft can change on its own and is hidden in one of the screen menus. You'll have to fly by feel and continue to practice for the F18. Short answer for fuel weight is yes. DCS VoiceAttack Profiles | My Mods and Utilities on ED User Files | DiCE: DCS Integrated Countermeasure Editor DCS Update Witching Utility | DCS-ExportScripts for Stream Deck Community Github Library Link to comment Share on other sites More sharing options...
Chewmann Posted January 10, 2022 Share Posted January 10, 2022 @Baileywhere would I find the values for the fuel weights? Link to comment Share on other sites More sharing options...
Recommended Posts