protected override async Task <bool> RunAsync() { if (CommonBehaviors.IsLoading) { await Coroutine.Wait(Timeout.Infinite, () => !CommonBehaviors.IsLoading); } if (QuestLogManager.InCutscene) { AgentCutScene cutscene = AgentCutScene.Instance; if (cutscene != null && cutscene.CanSkip) { cutscene.PromptSkip(); await Coroutine.Wait(1000, () => SelectString.IsOpen); if (SelectString.IsOpen) { SelectString.ClickSlot(0); } } } if (IsInInstance) { if (!IsDutyCommenced) { await Coroutine.Wait(TimeSpan.FromMinutes(5), () => IsDutyCommenced); } } return(false); }
/// <inheritdoc/> public override async Task <bool> Run() { if (CommonBehaviors.IsLoading) { StatusBar.Text = Translations.STATUS_LOADING_WAIT; Logger.LogInformation(Translations.STATUS_LOADING_WAIT); await Coroutine.Wait(Timeout.Infinite, () => !CommonBehaviors.IsLoading); return(HANDLED_EXECUTION); } if (QuestLogManager.InCutscene) { StatusBar.Text = Translations.STATUS_CUTSCENE_WAIT; Logger.LogInformation(Translations.STATUS_CUTSCENE_WAIT); AgentCutScene cutscene = AgentCutScene.Instance; if (cutscene != null && cutscene.CanSkip) { cutscene.PromptSkip(); await Coroutine.Wait(500, () => SelectString.IsOpen); if (SelectString.IsOpen) { Logger.LogInformation(Translations.LOG_CUTSCENE_SKIPPING); SelectString.ClickSlot(0); } return(HANDLED_EXECUTION); } } if (CurrentInstance.IsInInstance) { if (!CurrentInstance.IsDutyCommenced) { StatusBar.Text = Translations.STATUS_DUTY_WAIT_COMMENCED; Logger.LogInformation(Translations.STATUS_DUTY_WAIT_COMMENCED); await Coroutine.Wait(TimeSpan.FromMinutes(2), () => CurrentInstance.IsDutyCommenced); Logger.LogInformation(Translations.LOG_DUTY_COMMENCED, CurrentInstance.Id, CurrentInstance.Name); return(HANDLED_EXECUTION); } } return(PASS_EXECUTION); }