Jump to content

New StreamDeck Plugin


Recommended Posts

@ctytlerDo you think that SuperCarrier functionality can be made? Specifilally, the LSO panel. there are three buttons that you can press at the moment. Cut, Waveoff, and Deck On.


Edited by Bailey
Link to comment
Share on other sites

I have posted my issue on dcs-interface github but thought I should try and post my issue here as well to see if any other of you have had the issue and know of a fix. So basically i have wanted to fly liberation and other SP and COOP missions more lately but for some reason dcs interface only works for me on dedicated multiplayer servers and not in singleplayer or multiplayer hosted missions. Last time it worked in singleplayer i think was in the beginning of september and I hadnt used it so much again outside of dedicated servers since this time. 

In the ''spoiler'' you will see some sections i drew out from the export log file. The problem seems to bee that in singleplayer and in multiplayer hosted missions it doesnt run the communication after udp sender and udp listener have been created.

update #1. I have removed and added back the export scripts folder again but still with no sucsess. It still only for some reason when i want to use interface in a singleplayer mission create udp sender and udplistner without doing the other necessery steps that it does just fine when it works on a dedicated server.

Spoiler

(So basically after reading the export log this is what happens when it works when I fly with any module on a DEDICATED SERVER. 

ExportScript Version: 1.2.1
21:45:55:023 : Create UDPSender
21:45:55:023 : Create UDPListner
21:45:59:408 : No Module Found.
21:46:54:389 : run hight importance export Ikarus
21:46:54:404 : run hight importance export universally
21:46:54:404 : ======Begin========
21:46:54:404 : 1. ID: 121, Fromat: %.4f, Value: 0.0192
21:46:54:404 : 2. ID: 122, Fromat: %.4f, Value: 0.0000
21:46:54:404 : 3. ID: 124, Fromat: %.4f, Value: 0.1109
21:46:54:404 : 4. ID: 125, Fromat: %.4f, Value: 0.0111
21:46:54:404 : 5. ID: 127, Fromat: %.4f, Value: 0.1180
21:46:54:404 : 6. ID: 128, Fromat: %.4f, Value: 0.9156
21:46:54:404 : 7. ID: 130, Fromat: %.4f, Value: 0.0830 ))

 

(/And this is what it says when It doesnt communicate with dcs interface when i start a module in any type of singleplayer or hosted multiplyer mission

ExportScript Version: 1.2.1
21:37:02:483 : Create UDPSender
21:37:02:483 : Create UDPListner
21:37:02:483 : MyInfo: {
[Pitch] = number: "0"
[Type] = {
[level3] = number: "1"
[level1] = number: "1"
[level4] = number: "265"
[level2] = number: "1"
}
[Country] = number: "2"
[GroupName] = string: "olle37"
[Flags] = {
[Jamming] = boolean: "false"
[IRJamming] = boolean: "false"
[Born] = boolean: "true"
[Static] = boolean: "false"
[Invisible] = boolean: "false"
[Human] = boolean: "true"
[AI_ON] = boolean: "true"
[RadarActive] = boolean: "false"
}
[Coalition] = string: "Enemies"
[Heading] = number: "2.4360673427582"
[Name] = string: "AJS37"
[Position] = {
[y] = number: "15.339942932129"
[x] = number: "-281191.65625"
[z] = number: "646855.25"
}
[UnitName] = string: "Gungnir"
[LatLongAlt] = {
[Long] = number: "42.04369329962"
[Lat] = number: "42.246507519242"
[Alt] = number: "15.339942932129"
}
[CoalitionID] = number: "2"
[Bank] = number: "0"
}

21:37:02:485 : File Path: C:\Users\oscar\Saved Games\DCS.openbeta\Scripts\DCS-ExportScript\ExportsModules\AJS37.lua
21:37:02:485 : File 'C:\Users\oscar\Saved Games\DCS.openbeta\Scripts\DCS-ExportScript\ExportsModules\AJS37.lua' loaded
21:37:02:485 : Version:
21:37:02:485 : Config: 1.2.1
21:37:02:485 : Maps: 1.2.1
21:37:02:485 : Tools: 1.2.1
21:37:02:485 : AJS37: 1.2.1
21:37:02:485 : genericRadio: 1.2.1
21:37:02:485 : ExportScript: 1.2.1
21:37:02:485 : ExportScript.ConfigEveryFrameArguments Count: 115
21:37:02:485 : ExportScript.ConfigArguments Count: 152
21:37:02:485 : Detected Map: CaucasusBase )

 

So i have read through the export script documentation and cant see that anything is wrong in my export script luas

 

 


Edited by lassekongo
Link to comment
Share on other sites

33 minutes ago, Bailey said:

@ctytlerDo you think that SuperCarrier functionality can be made? Specifilally, the LSO panel. there are three buttons that you can press at the moment. Cut, Waveoff, and Deck On.

 

A draft of what the lua could look like. It the profile is possible, I can try to make one with images.
 

Spoiler
-- Supercarrier Export

ExportScript.FoundDCSModule = true
ExportScript.Version.Supercarrier = "1.2.1"

ExportScript.ConfigEveryFrameArguments = 
{ 
	--[[
	every frames arguments
	based of "mainpanel_init.lua"
	Example (http://www.lua.org/manual/5.1/manual.html#pdf-string.format)
	[DeviceID] = "Format"
	  [4] = "%.4f",  <- floating-point number with 4 digits after point
	 [19] = "%0.1f", <- floating-point number with 1 digit after point
	[129] = "%1d",   <- decimal number
	  [5] = "%.f",   <- floating point number rounded to a decimal number
	]]
	
	-- Enviro
	[2] = "%.4f",		-- Phone Visibility
	[3] = "%.4f",		-- Barrier {0.0, 1.0}
	
	-- Lights
	[10] = "%.4f",		-- Master Caution {0.0, 1.0}
	[11] = "%.4f",		-- CUT Bar
	[12] = "%.4f",		-- Waveoff Bar
	[13] = "%.4f",		-- IFLOLS NO GO Light 
	[14] = "%.4f",		-- IFLOLS OFF OK Light 
	[15] = "%.4f",		-- LOCK ON OFF Light 
	[16] = "%.4f",		-- MODE I II III Light
	[17] = "%.4f",		-- ACLS WAVEOFF Light
	[18] = "%.4f",		-- ARBS Button
	[19] = "%.4f",		-- ISIS SCREEN Button
	[20] = "%.4f",		-- WIND SCREEN Button
	[21] = "%.4f",		-- IFLOLS SCREEN Button
	[22] = "%.4f",		-- METOC SCREEN Button
	[23] = "%.4f",		-- MORE Button
	[24] = "%.4f",		-- BACK Button
	[25] = "%.4f",		-- MENU RETURN Button
	[26] = "%.4f",		-- MASTER CAUTION Button
	[27] = "%.4f",		-- CUT
	[28] = "%.4f",		-- WAVEOFF
	[29] = "%.4f",		-- IFLOLS 1 Button
	[30] = "%.4f",		-- IFLOLS 2 Button
	[31] = "%.4f",		-- ACLS LOCK Button
	[32] = "%.4f",		-- ACLS MODE Button
	[33] = "%.4f",		-- ACLS ACLS Button
	[34] = "%.4f",		-- DECK ON Button
	[35] = "%.4f",		-- Screen Brightness
	[36] = "%.4f",		-- DECK STATUS LIGHTS Lights Button
	[37] = "%.4f",		-- POWER Button
	[38] = "%.4f",		-- UPPER DISPLAY BRT Knob Left
	[39] = "%.4f",		-- UPPER DISPLAY CONT Knob
	[40] = "%.4f",		-- UPPER DISPLAY BRT Knob Right
	[41] = "%.4f",		-- LOWER DISPLAY BRT Knob Left
	[42] = "%.4f",		-- LOWER DISPLAY CONT Knob
	[43] = "%.4f",		-- LOWER DISPLAY BRT Knob Right
	[44] = "%.4f",		-- DAY NIGHT Knob
	[45] = "%.4f",		-- DECK STATUS LIGHTS BRT Knob
	[46] = "%.4f"		-- INDICATOR INTENSITY Knob
}

ExportScript.ConfigArguments = 
{
	--[[
	arguments for export in low tick interval
	based on "clickabledata.lua"
	]]
	
}

-----------------------------
-- HIGH IMPORTANCE EXPORTS --
-- done every export event --
-----------------------------

-- Pointed to by ProcessIkarusDCSHighImportance
function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
	--[[
	every frame export to Ikarus
	Example from A-10C
	Get Radio Frequencies
	get data from device
	local lUHFRadio = GetDevice(54)
	ExportScript.Tools.SendData("ExportID", "Format")
	ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
	ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
	]]
end

function ExportScript.ProcessDACConfigHighImportance(mainPanelDevice)
	--[[
	every frame export to DAC
	Example from A-10C
	Get Radio Frequencies
	get data from device
	local UHF_RADIO = GetDevice(54)
	ExportScript.Tools.SendDataDAC("ExportID", "Format")
	ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
	ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
	ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
	]]
end
-----------------------------------------------------
-- LOW IMPORTANCE EXPORTS                          --
-- done every gExportLowTickInterval export events --
-----------------------------------------------------

-- Pointed to by ExportScript.ProcessIkarusDCSConfigLowImportance
function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)
	--[[
	export in low tick interval to Ikarus
	Example from A-10C
	Get Radio Frequencies
	get data from device
	local lUHFRadio = GetDevice(54)
	ExportScript.Tools.SendData("ExportID", "Format")
	ExportScript.Tools.SendData(2000, string.format("%7.3f", lUHFRadio:get_frequency()/1000000)) -- <- special function for get frequency data
	ExportScript.Tools.SendData(2000, ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
	]]
end

function ExportScript.ProcessDACConfigLowImportance(mainPanelDevice)
	--[[
	every frame export to hardware
	Example from A-10C
	Get Radio Frequencies
	get data from device
	local UHF_RADIO = GetDevice(54)
	ExportScript.Tools.SendDataDAC("ExportID", "Format")
	ExportScript.Tools.SendDataDAC("ExportID", "Format", HardwareConfigID)
	ExportScript.Tools.SendDataDAC("2000", string.format("%7.3f", UHF_RADIO:get_frequency()/1000000))
	ExportScript.Tools.SendDataDAC("2000", ExportScript.Tools.RoundFreqeuncy((UHF_RADIO:get_frequency()/1000000))) -- ExportScript.Tools.RoundFreqeuncy(frequency (MHz|KHz), format ("7.3"), PrefixZeros (false), LeastValue (0.025))
	]]

	--=====================================================================================
	--[[
	ExportScript.Tools.WriteToLog('list_cockpit_params(): '..ExportScript.Tools.dump(list_cockpit_params()))
	ExportScript.Tools.WriteToLog('CMSP: '..ExportScript.Tools.dump(list_indication(7)))
	
	-- list_indication get tehe value of cockpit displays
	local ltmp1 = 0
	for ltmp2 = 0, 20, 1 do
		ltmp1 = list_indication(ltmp2)
		ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
	end
	]]
--[[
	-- getmetatable get function name from devices
	local ltmp1 = 0
	for ltmp2 = 1, 70, 1 do
		ltmp1 = GetDevice(ltmp2)
		ExportScript.Tools.WriteToLog(ltmp2..': '..ExportScript.Tools.dump(ltmp1))
		ExportScript.Tools.WriteToLog(ltmp2..' (metatable): '..ExportScript.Tools.dump(getmetatable(ltmp1)))
	end
]]
end

-----------------------------
--     Custom functions    --
-----------------------------

 


 

Link to comment
Share on other sites

I have weird problem with stream deck and the plugin. It is installed properly and works well. I have profiles for A10 and F18. But I cannot create a button for the left DDT brightness control (the dial that turns on the left DDI and has off, night, and day settings).

 

The left DDI brightness selector knob does not respond when an Incremental Input (text above) button is created with these settings:
DCS command
Button ID: 3001
Device ID: 35
DCS ID: 51
Increment by value: 0.1
Increment Range: 0.0 1.0
Allow cycling
Image State Change and Title text change both use the button ID 51

The right DDI brightness selector knob works fine with corresponding settings:
DCS command
Button ID: 3001
Device ID: 36
DCS ID: 76
Increment by value: 0.1
Increment Range: 0.0 1.0
Allow cycling
Image State Change and Title text change both use the button ID 76
All the other knobs (brightness control, contrast control) work fine for all three DDIs

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

Looking for some help with creating a function to display the A10 fuel totalizer. I've tried adapting Bailey's F16 lines of code, but no luck.

Here's what I've got so far. Any help greatly appreciated.

function ExportScript.FuelInfo(mainPanelDevice)    
        local FuelTotalizer_10k = mainPanelDevice:get_argument_value(90) * 100000
        local FuelTotalizer_1k = math.floor(mainPanelDevice:get_argument_value(91) * 10) * 1000 -- this method counters the odd rounding seen with roller counters
        local FuelTotalizer_100 = mainPanelDevice:get_argument_value(92) * 1000
    
        local totalFuel = FuelTotalizer_10k + FuelTotalizer_1k + FuelTotalizer_100
        totalFuel = round(totalFuel, 0)
        totalFuel = format_int(totalFuel)
        ExportScript.Tools.SendData(2007, "Fuel LBS\n" .. totalFuel)
            
    end

Link to comment
Share on other sites

I'm having an issue trying to figure out how to get the F/A-18 fire extinguisher push to discharge button functioning. My idea was to set this button up similar to the ALR-67 buttons @ctytler's tutorial did.  I can get the DISCH to illuminate when I press the button (easy), but the issue is there are 3 states that can illuminate the READY.  However there is only 1 state/argument to look for to change the title text on DCS update setting.  Is it possible to make it look for three; left engine fire, right engine fire, and APU fire? 

Another thought just occurred to me, how do I test this? How do I start fires in my engines and APU.?  And what are the “light” ID numbers?  
 

Damn this one is hard…  but I know @Bailey can do it.  LOL

Link to comment
Share on other sites

2 hours ago, skypickle said:

How do I configure streamdeck plugin for custom  modules like A-4E-C? Hercules? Only the official modules appear in the list?

I think you need a lua file for each module, otherwise you won't be able to link it.

I am not sure if there are lua's avialable for download for mods like A-4E.

So many modules, so little time...

 

www.mikphotography.com

Link to comment
Share on other sites

10 hours ago, Chewmann said:

I'm having an issue trying to figure out how to get the F/A-18 fire extinguisher push to discharge button functioning. My idea was to set this button up similar to the ALR-67 buttons @ctytler's tutorial did.  I can get the DISCH to illuminate when I press the button (easy), but the issue is there are 3 states that can illuminate the READY.  However there is only 1 state/argument to look for to change the title text on DCS update setting.  Is it possible to make it look for three; left engine fire, right engine fire, and APU fire? 

Another thought just occurred to me, how do I test this? How do I start fires in my engines and APU.?  And what are the “light” ID numbers?  
 

Damn this one is hard…  but I know @Bailey can do it.  LOL

When there is an APU fire, Left engine fire, or Right engine fire, you want a single StreamDeck button to say which thing is on fire and then when you press it, it fires the Discharge switches in-game? 
 

If that’s the case there are two major things you will have to do or figure out. First is the changing text. Second is the way to press the discharge switch. 

For the first issue, that is going to be a “simple” IF statement. At the end of the if statement you will export the text to a unique ID. For example, IF argument(apuLight) equals 1(on), then textToDisplay = APU FIRE. ELSEIF argument(leftEngineFireLight) = 1, then textToDisplay = L ENG FIRE. And so on. At the end you’ll export textToDisplay to a unique ID for your button.
 

The tricky part is part two. If I remember correctly, the switch has a cover. I don’t know if the switch is press-able ingame while the cover is on. Maybe, maybe not. If it is not, you’ll have to counter that in two ways. Either making 2 buttons or making a multi action button using the multi action function in the streamdeck app. 
 

Good luck! If you get stuck I’ll be glad to assist. Oh, and unless it’s already defined, you’ll have to use the model explorer to find the correct argument of the lights. Which means changing them one by one. Or if you are lucky you can find a profile that already has those lights built into it. 

Link to comment
Share on other sites

Thanks @Bailey   I didn’t realize you can add logic arguments. That should make it much easier. 

I have the switch cover open , button press and the close switch cover solved with a multi-action switch. Pretty easy.  

If, and that’s a big if, I can figure it out I’ll post what I did.

  • Like 1
Link to comment
Share on other sites

Disclaimer:  I have never written nor edited a lua file in the past.  This is my first go, so don't laugh at my attempts  🙃 

I added a variable to the Fire Systems list

[599] = "%1d"  -- Left Engine AMAD/Right Engine AMAD/APU Fire Extinguisher Discharge READY Light

Then added the following script at the very bottom of the lua file (below the "Custom functions" block)...


function ExportScript.ProcessDACConfigLowImportance

if 11 = 1  -- Left Engine Fire button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)
 
 elseif 27 = 1  -- Right Engine Fire Button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)
 
 elseif 30 = 1  -- APU Fire Button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)

else ExportScript.Tools.SendDataDAC(599,0)

end

When I replaced the .lua in the ExportsModules, my Streamdeck cannot communicate with DCS.  I put the original one back in and everything is fine.  So, why is it not communicating with DCS and how does the script look?

FA-18C_hornet TEST.lua

Link to comment
Share on other sites

23 hours ago, Chewmann said:

Disclaimer:  I have never written nor edited a lua file in the past.  This is my first go, so don't laugh at my attempts  🙃 

I added a variable to the Fire Systems list

[599] = "%1d"  -- Left Engine AMAD/Right Engine AMAD/APU Fire Extinguisher Discharge READY Light

Then added the following script at the very bottom of the lua file (below the "Custom functions" block)...


function ExportScript.ProcessDACConfigLowImportance

if 11 = 1  -- Left Engine Fire button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)
 
 elseif 27 = 1  -- Right Engine Fire Button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)
 
 elseif 30 = 1  -- APU Fire Button Pushed In
   ExportScript.Tools.SendDataDAC(599,1)

else ExportScript.Tools.SendDataDAC(599,0)

end

When I replaced the .lua in the ExportsModules, my Streamdeck cannot communicate with DCS.  I put the original one back in and everything is fine.  So, why is it not communicating with DCS and how does the script look?

FA-18C_hornet TEST.lua 38.14 kB · 1 download

For a first time lua edit, that isn't half bad! I can see that you are developing your way of thinking of a solution. That is good, as it only gets better with time and practice.

I took a shot at it and here is what I got. There are may ways to "think" in lua, and many more ways to write it. Below you will see my code for the function in a Spoiler block so that it does not take up so much space. I tried to comment as much as made sense. You could really write a novel on this stuff if you really wanted to. As a general note, make sure to use Notepad++ or a similar editor. It helps a lot. (I really need an IDE or something because I spent like 30 minutes tracking down a rouge "L" typo that should have been an "i". Sigh...the life of lua 😄. Almost took me monger to find it than it took to write the code.)


 

Spoiler
function ExportScript.TripleFireFeature(mainPanelDevice)
	--This function will get the status of the three fire lights. 
	--When a light is lit, its text will be exported
	
	--we will make the variable 'light_leftEngFireValue'
	--it will contain the value of the light animation for the left engine fire light
	local light_leftEngFireValue = mainPanelDevice:get_argument_value(10)

	--'light_rightEngFireValue' will contain the value of the light animation for the right engine fire light
	local light_rightEngFireValue = mainPanelDevice:get_argument_value(26)
	
	--'light_apuFireValue' will contain the value of the light animation for the apu fire light
	local light_apuFireValue = mainPanelDevice:get_argument_value(29)
	
	--now that we have all of the values, we have to create some logic to see if any of them are on
	
	--a variable that begins with "is" can be considered a boolean,
	--which means we will make it true or false, represented by 1 or 0, respectively
	
	local isLeftEngFireLit
	local isRightEngFireLit
	local isApuFireLit
	
	--using the modelViewer, you can see that the light comes on for values above 0.51-ish
	--we will take that value and determine the true/false of its related boolean (bool)
	if light_leftEngFireValue > 0.51 then
		isLeftEngFireLit = 1
	else
		isLeftEngFireLit = 0
	end
	
	--we will do the same for the right engine and apu
	if light_leftEngFireValue > 0.51 then
		isRightEngFireLit = 1
	else
		isRightEngFireLit = 0
	end
	
	if light_apuFireValue > 0.51 then
		isApuFireLit = 1
	else
		isApuFireLit = 0
	end
	
	--now that we have the status of all of the lights, we will use them in another logic
	local isFireHappening
	--if any of these values are true, there is a fire
	if (isLeftEngFireLit == 1) or (isRightEngFireLit == 1) or (isApuFireLit == 1) then
		isFireHappening = 1
	else
		isFireHappening = 0
	end
	
	--now we export the results in a unique export ID
	ExportScript.Tools.SendData(3000, isFireHappening)
	
	--But, remember how we also wanted the text too?
	--We will do that like this
	--if a light is lit, then we populate the variable with a string
	--we will call that variable 'whatIsOnFire'
	local whatIsOnFire
	if isLeftEngFireLit == 1 then
		whatIsOnFire = "L ENG"
	elseif isRightEngFireLit == 1 then
		whatIsOnFire = "R ENG"
	elseif isApuFireLit == 1 then
		whatIsOnFire = "APU"
	else
		whatIsOnFire = ""  --it will be blank if nothing is on fire
	end
	
	--use 3001 as a 'Title Text Change' in the streamdeck
	ExportScript.Tools.SendData(3001, whatIsOnFire)
end

 


Remember to add
 

ExportScript.TripleFireFeature(mainPanelDevice) 

at line 559, in the 'ProcessIkarusDCSConfigLowImportance' block.

Let me know how it goes!

FA-18C_hornet.lua


Edited by Bailey
  • Like 1
Link to comment
Share on other sites

On 12/8/2021 at 4:13 AM, Tess said:

Looking for some help with creating a function to display the A10 fuel totalizer. I've tried adapting Bailey's F16 lines of code, but no luck.

Here's what I've got so far. Any help greatly appreciated.

function ExportScript.FuelInfo(mainPanelDevice)    
        local FuelTotalizer_10k = mainPanelDevice:get_argument_value(90) * 100000
        local FuelTotalizer_1k = math.floor(mainPanelDevice:get_argument_value(91) * 10) * 1000 -- this method counters the odd rounding seen with roller counters
        local FuelTotalizer_100 = mainPanelDevice:get_argument_value(92) * 1000
    
        local totalFuel = FuelTotalizer_10k + FuelTotalizer_1k + FuelTotalizer_100
        totalFuel = round(totalFuel, 0)
        totalFuel = format_int(totalFuel)
        ExportScript.Tools.SendData(2007, "Fuel LBS\n" .. totalFuel)
            
    end

So close! It looks like you were off by about a factor of 10. The A-10C.lua already has a totalizer calculation, but the author didn't copy it to the correct place in the file for the app. Instead of telling you some possibly confusing stuff, I'll just add the lua and post a snip of the code. It is working ingame.

 

Spoiler
-- Calculate Total Fuel
	--------------------------------------------------------
	local lFuelQuantityCounterTenthOfThous = mainPanelDevice:get_argument_value(90) * 10000 			-- {0.0, 10.0} {0.0, 1.0}
	local lFuelQuantityCounterThousands = mainPanelDevice:get_argument_value(91) * 1000 				-- {0.0, 10.0} {0.0, 1.0}
	local lFuelQuantityCounterHundreds = mainPanelDevice:get_argument_value(92) * 100					-- {0.0, 10.0} {0.0, 1.0}
	-- orginal
	local lFuelQuantityCounter = ((lFuelQuantityCounterTenthOfThous + lFuelQuantityCounterThousands + lFuelQuantityCounterHundreds) / 10) 		
	ExportScript.Tools.SendData("2007", string.format("%0.0f", lFuelQuantityCounter).."00")

 

 

Edit: If you are wanting to use the 'round' nd 'format_int' functions, you will have to add the functions from the F16 lua to the a10 lua when you modify it.

A-10C.lua


Edited by Bailey
  • Thanks 1
Link to comment
Share on other sites

On 11/28/2021 at 3:07 AM, hasole said:

Is anyone out there having issues with ExportScripts not talking to DCS even though the log file can find the airframe when you jump into sim.  My DCS comms in the stream deck checks out and can read from the game.

The only thing that fixes it is a reboot of Windows 10.  Happens intermittently.

Possibly. I can’t repeat the possible error at will. I typically kill the SD process and replug  the SD to fix it. 

Link to comment
Share on other sites

On 12/16/2021 at 11:51 AM, Bailey said:

Possibly. I can’t repeat the possible error at will. I typically kill the SD process and replug  the SD to fix it. 

Good thinking, I'll try that next time.  I've been jumping quickly into an Instant Action mission to check before I play a campaign or MP.

Link to comment
Share on other sites

5 hours ago, hasole said:

Good thinking, I'll try that next time.  I've been jumping quickly into an Instant Action mission to check before I play a campaign or MP.

There are some times where I feel like I had to restart DCS. Hard to say what fixes the problem. Good luck!

Link to comment
Share on other sites

5 hours ago, Chewmann said:

Is there a P47 lua for the Streamdeck?  I did a search and couldn't find specific info on it.  Of course I just bought it with the hopes of using the Streamdeck to make things easier....

 

Merry Christmas to me.  🙄

Here you go. Merry Christmas. 
https://github.com/asherao/DCS-ExportScripts/blob/master/Scripts/DCS-ExportScript/ExportsModules/P-47D-30.lua

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...