buur Posted June 4, 2022 Share Posted June 4, 2022 (edited) Hello everybody. I've created a little script that automatically add additional information like frequencies or TACAN to the F10 Menu. At the moment it works for AWACS, JTACS and Tanker. Usage is simple: Load the script at the mission start after loading MIST. At the moment it works only for the blue coalition but it is easy to switch it to the other coalitions. This script works not with late activated units or units that are spawned by a script. Maybe it is helpful for somebody. Edit: 2022.06.12: added version 0.2 -- ServiceProvider v0.2: a script by buur. It provides radio and other stuff from servic provider like tanker, AWACS or FAC -- ToDo: FARPS and Carrier. JTACs with more than one target will have several entries for their own position -- Changelog: protect Tanker, AWACS again late activated units. (not shown in mist database); EWR Radars are added function infoAWACS() local msg = {} msg[#msg + 1] = "AWACS\\EWR:" msg[#msg + 1]='\n' local ServiceProvider = coalition.getServiceProviders(2 , 1 ) if next(ServiceProvider) ~= nil then do for ke,val in pairs(ServiceProvider) do if ServiceProvider[ke]:getCallsign() then callsign = ServiceProvider[ke]:getCallsign() else callsign = "N/A" end local nametype = ServiceProvider[ke]:getTypeName() msgstr = nametype.." "..callsign.." " local ServiceProvider = ServiceProvider[ke]:getGroup():getName() local groupServiceProvider = mist.getGroupData(ServiceProvider) local routeServiceProvider = mist.getGroupRoute(ServiceProvider , true) Modulation = {[0]="AM", [1]="FM"} if groupServiceProvider["frequency"] then -- get the values from lua database only when they exists msgstr = msgstr.."Freq: "..groupServiceProvider["frequency"].." "..Modulation[groupServiceProvider["modulation"]].." " local t=mist.getGroupRoute( ServiceProvider , true )[1]["task"]["params"]["tasks"] elseif routeServiceProvider[1]["task"]["params"]["tasks"][1]["id"] == "EWR" then Modulation = {[0]="AM", [1]="FM"} EWR_tasks = routeServiceProvider[1]["task"]["params"]["tasks"] for key,value in pairs(EWR_tasks) do if EWR_tasks[key]["id"] == "WrappedAction" then local EWR_frequency = EWR_tasks[key]["params"]["action"]["params"]["frequency"] local EWR_Modulation = EWR_tasks[key]["params"]["action"]["params"]["modulation"] msgstr = msgstr.."Freq: "..EWR_frequency/1000000 .." "..Modulation[EWR_Modulation] end end end msg[#msg + 1] = msgstr msg[#msg + 1]='\n' end trigger.action.outText(table.concat(msg), 30, false) end end end function infoFAC() msg = {} msg[#msg + 1] = "FAC:" msg[#msg + 1]='\n' local ServiceProvider = coalition.getServiceProviders(2 , 3 ) if next(ServiceProvider) ~= nil then do for ke,val in pairs(ServiceProvider) do local callsign = ServiceProvider[ke]:getCallsign() local curPoint = ServiceProvider[ke]:getPoint() local lat, lon, alt = coord.LOtoLL(curPoint) local grid = coord.LLtoMGRS(lat,lon) local msgstr = callsign.." ".."at Position: " ..grid.UTMZone .. ' ' .. grid.MGRSDigraph .. ' '.. grid.Easting .. ' ' .. grid.Northing.." "--..lat.." "..lon local ServiceProvider = ServiceProvider[ke]:getGroup():getName() local t=mist.getGroupRoute( ServiceProvider , true )[1]["task"]["params"]["tasks"] for key,value in pairs(t) do if (t[key]["id"] == "FAC_AttackGroup") or (t[key]["id"] == "FAC") or (t[key]["id"] == "FAC_EngageGroup") then Modulation = {[0]="AM", [1]="FM"} local FAC_frequency = (t[key]["params"]["frequency"]) local FAC_Modulation = (t[key]["params"]["modulation"]) local msgstr = msgstr.."Freq: "..FAC_frequency/1000000 .." "..Modulation[FAC_Modulation] msg[#msg + 1] = msgstr msg[#msg + 1]='\n' end end end trigger.action.outText(table.concat(msg), 30, false) end end end function infoTanker() msg = {} msg[#msg + 1] = "Tanker:" msg[#msg + 1]='\n' local ServiceProvider = coalition.getServiceProviders(2 , 2 ) if next(ServiceProvider) ~= nil then do for ke,val in pairs(ServiceProvider) do local callsign = ServiceProvider[ke]:getCallsign() local nametype = ServiceProvider[ke]:getTypeName() msgstr = nametype.." "..callsign.." " local ServiceProvider = ServiceProvider[ke]:getGroup():getName() local groupServiceProvider = mist.getGroupData(ServiceProvider) Modulation = {[0]="AM", [1]="FM"} if groupServiceProvider["frequency"] then -- get the values from lua database only when they exists msgstr = msgstr.."Freq: "..groupServiceProvider["frequency"].." "..Modulation[groupServiceProvider["modulation"]].." " local t=mist.getGroupRoute( ServiceProvider , true )[1]["task"]["params"]["tasks"] for key,value in pairs(t) do if t[key]["id"] == "WrappedAction" then local TCN_channel = t[key]["params"]["action"]["params"]["channel"] local TCN_modeChannel = t[key]["params"]["action"]["params"]["modeChannel"] local TCN_callsign = t[key]["params"]["action"]["params"]["callsign"] local msgstr = msgstr.."TCN: "..TCN_channel..TCN_modeChannel.." "..TCN_callsign msg[#msg + 1] = msgstr msg[#msg + 1]='\n' end end end end trigger.action.outText(table.concat(msg), 30, false) end end end local displayInfo = missionCommands.addSubMenuForCoalition(2, "Display Information", nil) local displayAWACS = missionCommands.addCommandForCoalition(2 , "Diplay AWACS\\EWR" , displayInfo , infoAWACS, {} ) local displayFAC = missionCommands.addCommandForCoalition(2 , "Diplay FAC" , displayInfo , infoFAC, {} ) local displayTanker = missionCommands.addCommandForCoalition(2 , "Diplay Tanker" , displayInfo , infoTanker, {} ) Edited June 12, 2022 by buur 1 Link to comment Share on other sites More sharing options...
mike5cents Posted June 5, 2022 Share Posted June 5, 2022 This is fantastic! I'm getting the AWACS and the FAC but not the tankers. Anything special I need to do to ensure the tankers display? Link to comment Share on other sites More sharing options...
buur Posted June 5, 2022 Author Share Posted June 5, 2022 no, there is nothing special. Can you send me your mission please so I can check? Link to comment Share on other sites More sharing options...
mike5cents Posted June 5, 2022 Share Posted June 5, 2022 Most of the tankers are late activated but spawned immediately at the start. Thought it might be that so I also threw in a non-late activated tanker. No luck. I'm sure I'm doing something stupid! 05_EX_Pac_Shield.miz Link to comment Share on other sites More sharing options...
buur Posted June 6, 2022 Author Share Posted June 6, 2022 Hi @mike5cents, unfortunately I have not the Mods of the Iowa Class, HH-60 and Project Defender by Admiral189. Can you provide a Mission without mods? Link to comment Share on other sites More sharing options...
mike5cents Posted June 6, 2022 Share Posted June 6, 2022 Sorry - I should have thought of that. I created a simplified no-mod mission. Looks like when I have late activated tankers that are spawned using MOOSE the script isn't able to find them. FREQ_TEST.miz Link to comment Share on other sites More sharing options...
buur Posted June 6, 2022 Author Share Posted June 6, 2022 ok, I got the problem. At the moment the script breaks when you use the spawn command from Moose. Background is that the spawn command creates a new group. If Arco-1 is your template, Moose will create a new Group called Arco-1#001. These group does not exist in the mist database. I have to think about a good solution for that. 1 Link to comment Share on other sites More sharing options...
buur Posted June 12, 2022 Author Share Posted June 12, 2022 (edited) Add a new version: Now the scrip will not recognize late activated units. The script finds now EWR script in first post is actualized Edited June 12, 2022 by buur Link to comment Share on other sites More sharing options...
Recommended Posts