mirror of
https://github.com/iTracerFacer/DCS_MissionDev.git
synced 2025-12-03 04:14:46 +00:00
28 lines
747 B
Lua
28 lines
747 B
Lua
--env.info("Loading AWACS Script", true)
|
|
|
|
Spawn_RED_AWACS = SPAWN:New("REDAWACS")
|
|
:InitLimit(1, 100)
|
|
:SpawnScheduled(120,.5)
|
|
|
|
-- Define the AWACS
|
|
local REDAWACS = GROUP:FindByName("REDAWACS")
|
|
-- Get the mission waypoints
|
|
local waypoints = REDAWACS:GetTemplateRoutePoints()
|
|
|
|
-- Set up the AWACS to patrol between the waypoints
|
|
REDAWACS:
|
|
|
|
-- Set up fuel check every 20 minutes
|
|
SCHEDULER:New(nil, function()
|
|
local fuelState = REDAWACS:GetFuel()
|
|
|
|
if fuelState < 0.2 then
|
|
MESSAGE:New("AWACS is RTB due to low fuel!", 15, "AWACS", false):ToRed()
|
|
REDAWACS:RouteRTB("Al Mansurah",330)
|
|
else
|
|
REDAWACS:MessageToRED(string.format("AWACS fuel state is %.1f%%", fuelState * 100), 15)
|
|
end
|
|
end, {}, 1200, 1200)
|
|
|
|
|