declare function AutoStage{ if not EnginesInStageActive(ship:stagenum) { stage. wait 0.1. } } local function EnginesInStageActive{ parameter targetStage. list engines in allEngines. for eng in allEngines{ if eng:stage = targetStage { if eng:IGNITION and eng:flameout { return false. } } } return true. } local function IsFairingStage{ parameter s. } local function StateHasEngines{ parameter s. }