mirror of
https://github.com/weyne85/DCS-ExportScripts.git
synced 2025-10-29 16:58:18 +00:00
Update Mi-24P.lua
Flare and chaff count is less likely to break on DCS updates
This commit is contained in:
parent
62d62f968b
commit
7aa0050960
@ -1095,8 +1095,27 @@ function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||
|
||||
local hindKneeboardInfo = ExportScript.Tools.split(list_indication(8), "%c")--this contains the formated table of the kneeboard
|
||||
|
||||
local txt_FLARES_Count = hindKneeboardInfo[18]
|
||||
local txt_CHAFFS_Count = hindKneeboardInfo[24]
|
||||
-- Old way of getting the values. Was hardcoded and could break of DCS updates
|
||||
--local txt_FLARES_Count = hindKneeboardInfo[15] -- original 18
|
||||
--local txt_CHAFFS_Count = hindKneeboardInfo[21] -- original 24
|
||||
|
||||
-- New way of detecting the counts, borrowed from Wizard and the F16
|
||||
local txt_FLARES_Count
|
||||
|
||||
for k,v in pairs(hindKneeboardInfo) do
|
||||
if v == "txt_FLARES_Count" then
|
||||
txt_FLARES_Count = hindKneeboardInfo[k+1]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local txt_CHAFFS_Count
|
||||
|
||||
for k,v in pairs(hindKneeboardInfo) do
|
||||
if v == "txt_CHAFFS_Count" then
|
||||
txt_CHAFFS_Count = hindKneeboardInfo[k+1]
|
||||
end
|
||||
end
|
||||
|
||||
ExportScript.Tools.SendData(3022, string.format(txt_FLARES_Count))
|
||||
ExportScript.Tools.SendData(3023, string.format(txt_CHAFFS_Count))
|
||||
@ -1104,6 +1123,9 @@ function ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)
|
||||
ExportScript.Tools.SendData(3025, string.format("CHAFF\n" .. txt_CHAFFS_Count))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-------------------
|
||||
-----Hind mike-----
|
||||
-------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user