public async Task <bool> Run() { if (WorldManager.ZoneId != Constants.LobbyMapId) { return(false); } TreeRoot.StatusText = "Lobby Room"; if (_target == null || !_target.IsValid) { Logger.Warn("Unable to find Lobby Target"); return(false); } if (!Navigator.InPosition(_target.Location, Core.Me.Location, 3)) { if (!await CommonTasks.MoveAndStop(new MoveToParameters(_target.Location, "Moving to Lobby Exit"), 3)) { Logger.Warn("Failed to move toward the exit?"); } else { DeepTracker.EndRun(false); } return(true); } _target.Interact(); await Coroutine.Wait(250, () => SelectYesno.IsOpen); SelectYesno.ClickYes(); DeepTracker.EndRun(false); return(true); }
public async Task <bool> Run() { if (RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult") != null && Core.Me.IsDead) { GameStatsManager.Died(); Logger.Warn("We have died..."); DeepTracker.Died(); DeepTracker.EndRun(true); RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult").SendAction(1, 3, uint.MaxValue); await Coroutine.Sleep(250); return(true); } if (RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult") != null) { //GameStatsManager.Died(); //Logger.Warn("We have died..."); //DeepTracker.Died(); DeepTracker.EndRun(false); RaptureAtkUnitManager.GetWindowByName("DeepDungeonResult").SendAction(1, 3, uint.MaxValue); await Coroutine.Sleep(250); return(true); } if (NotificationRevive.IsOpen) { NotificationRevive.Click(); await Coroutine.Wait(250, () => SelectYesno.IsOpen); SelectYesno.ClickYes(); return(true); } if (ClientGameUiRevive.ReviveState == ReviveState.Dead && SelectYesno.IsOpen) { SelectYesno.ClickYes(); return(true); } if (Core.Me.IsDead) { TreeRoot.StatusText = "I am dead. No window to use..."; await Coroutine.Sleep(250); return(true); } return(false); }
public async Task <bool> Run() { if (WorldManager.ZoneId != Constants.EntranceZoneId) { return(false); } if (Settings.Instance.Stop) { TreeRoot.Stop("Stop Requested"); DeepTracker.EndRun(true); return(true); } if (ContentsFinderConfirm.IsOpen) { Logger.Warn($"Entering {Constants.SelectedDungeon.GetDDType()} - Currently a Level {Core.Me.ClassLevel} {Core.Me.CurrentJob}"); DeepTracker.StartRun(Core.Me.ClassLevel); ContentsFinderConfirm.Commence(); await Coroutine.Wait(TimeSpan.FromMinutes(2), () => QuestLogManager.InCutscene || NowLoading.IsVisible); DungeonQueue.Stop(); return(true); } //TODO InQueue if (!DungeonQueue.IsFinished) { TreeRoot.StatusText = "Waiting on Queue"; await Coroutine.Wait(500, () => ContentsFinderConfirm.IsOpen); Logger.Info("Waiting on Queue"); return(true); } if (!HasWindowOpen) { if (Constants.UseJobList) { Logger.Info("Checking Joblist"); await CheckJobQueue(); } await OpenMenu(); return(true); } await MainMenu(); return(true); }
public async Task <bool> Run() { if (WorldManager.ZoneId != Constants.SelectedDungeon.LobbyId) { return(false); } await Coroutine.Sleep(5000); _target = GameObjectManager.GameObjects.Where(r => r.NpcId == EntityNames.LobbyExit).OrderBy(r => r.Distance()).FirstOrDefault(); Navigator.Stop(); Navigator.Clear(); TreeRoot.StatusText = "Lobby Room"; if (_target == null || !_target.IsValid) { Logger.Warn("Unable to find Lobby Target"); return(false); } // move closer plz if (_target.Location.Distance2D(Core.Me.Location) >= 4.4) { Logger.Verbose("target range " + _target.Location.Distance2D(Core.Me.Location)); Navigator.Stop(); Navigator.PlayerMover.MoveStop(); Navigator.PlayerMover.MoveTowards(_target.Location); while (_target.Location.Distance2D(Core.Me.Location) >= 4.4) { Logger.Verbose("Moving towards " + _target.Location); Navigator.PlayerMover.MoveTowards(_target.Location); await Coroutine.Sleep(100); } //await Buddy.Coroutines.Coroutine.Sleep(1500); // (again, probably better to just wait until distance to destination is < 2.0f or something) Navigator.PlayerMover.MoveStop(); } _target.Interact(); await Coroutine.Wait(500, () => SelectYesno.IsOpen); await Coroutine.Sleep(1000); SelectYesno.ClickYes(); DeepTracker.EndRun(false); return(true); }
public async Task <bool> Run() { if (!Constants.InExitLevel) { return(false); } await Coroutine.Sleep(5000); //_target = GameObjectManager.GetObjectByNPCId(EntityNames.LobbyExit); _target = GameObjectManager.GameObjects.Where(r => r.NpcId == EntityNames.LobbyExit) .OrderBy(r => r.Distance()).FirstOrDefault(); //Vector3 loc = new Vector3(-10.02527f, 0.01519775f, -150.0115f); Navigator.Stop(); Navigator.Clear(); TreeRoot.StatusText = "Lobby Room"; if (_target == null || !_target.IsValid) { Logger.Warn("Unable to find Lobby Target"); return(false); } // move closer plz if (_target.Location.Distance2D(Core.Me.Location) >= 4.4) { // await CommonTasks.MoveAndStop(new MoveToParameters(_target.Location, "Lobby Exit"), 1f, true); Logger.Verbose("target range" + _target.Location.Distance2D(Core.Me.Location)); Navigator.Stop(); //Vector3 exit = GameObjectManager.GetObjectByNPCId(EntityNames.LobbyExit).Location; Navigator.PlayerMover.MoveTowards(_target.Location); while (_target.Location.Distance2D(Core.Me.Location) >= 4.4) { Navigator.PlayerMover.MoveTowards(_target.Location); await Coroutine.Sleep(100); } //await Buddy.Coroutines.Coroutine.Sleep(1500); // (again, probably better to just wait until distance to destination is < 2.0f or something) Navigator.PlayerMover.MoveStop(); //return false; } // await Coroutine.Sleep(5000); //await Coroutine.Wait(-1, () => Core.Me.InCombat || !Constants.InExitLevel || CommonBehaviors.IsLoading || QuestLogManager.InCutscene); //Poi.Clear("Floor has changed or we have entered combat"); //Navigator.Clear(); //GameObjectManager.GetObjectByNPCId(EntityNames.LobbyExit)).Location /* if (Core.Me.Location.Distance2D(loc) >= 2) * { * Navigator.Clear(); * await CommonTasks.StopMoving(); * * Navigator.Stop(); * Vector3 exit = GameObjectManager.GetObjectByNPCId(EntityNames.LobbyExit).Location; * Navigator.PlayerMover.MoveTowards(exit); * await Buddy.Coroutines.Coroutine.Sleep(1500); // (again, probably better to just wait until distance to destination is < 2.0f or something) * Navigator.PlayerMover.MoveStop(); * * //GameObjectManager.GetObjectByNPCId(EntityNames.LobbyExit).Location * // if (!Navigator.InPosition(_target.Location, Core.Me.Location, 10)) * // { * // if (!await CommonTasks.MoveAndStop(new MoveToParameters(_target.Location, "Moving to Lobby Exit"), 3)) * // { * // Logger.Warn("Failed to move toward the exit?"); * // } * // return true; * // } * Logger.Verbose("target2 range" + _target.Location.Distance2D(Core.Me.Location)); * }*/ _target.Interact(); await Coroutine.Wait(500, () => SelectYesno.IsOpen); await Coroutine.Sleep(1000); SelectYesno.ClickYes(); DeepTracker.EndRun(false); return(true); }
/// <summary> /// Handles opening treasure coffers or opening an exit portal /// </summary> /// <returns></returns> internal async Task <bool> TreasureOrExit() { var tries = 0; var npcid = Target.Unit.NpcId; if (Target.Location.Distance2D(Core.Me.Location) >= 3) { await CommonTasks.MoveAndStop(new MoveToParameters(Target.Location, Target.Name), 2.5f, true); return(true); } pomanderCapped = false; //Unsubscribe first to prevent subscriptions from persisting //GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied; // GamelogManager.MessageRecevied += GamelogManagerOnMessageRecevied; while (!DeepDungeonCombined.StopPlz && Target.Unit != null && Target.Unit.IsValid && tries < 3) { try { //if we are a transformed we can't open a chest if (Constants.AuraTransformed) { Logger.Warn("Unable to open chest. Waiting for aura to end..."); await CommonTasks.StopMoving("Waiting on aura to end"); await Coroutine.Wait(TimeSpan.FromSeconds(30), () => !Constants.AuraTransformed || Core.Me.InCombat || DeepDungeonCombined.StopPlz); return(true); } await Coroutine.Yield(); if (Core.Me.HasAura(Auras.Lust)) { await Tasks.Common.CancelAura(Auras.Lust); } Logger.Verbose("Attempting to interact with: {0} ({1} / 3)", Target.Name, tries + 1); if (!PartyManager.IsInParty || PartyManager.IsPartyLeader || PartyManager.IsInParty && Constants.IsExitObject(Target.Unit)) { await CommonTasks.StopMoving("Interacting with chest"); if (!await ObjectInteraction(Target.Unit)) { break; } } else { await CommonTasks.StopMoving("Waiting for leader to use chest"); } await Coroutine.Sleep(700); if (!Target.Unit.IsValid) { break; } if (!Target.Unit.IsTargetable) { break; } if (SelectYesno.IsOpen) { break; } } finally { tries++; DeepDungeonManager.PomanderChange(); } } GamelogManager.MessageRecevied -= GamelogManagerOnMessageRecevied; await Coroutine.Wait(500, () => SelectYesno.IsOpen); //if this is an exit if (SelectYesno.IsOpen) { SelectYesno.ClickYes(); await Coroutine.Sleep(1000); Logger.Verbose("Is window open : {0}", DeepDungeonResult.Instance.IsOpen); if (DeepDungeonResult.Instance.IsOpen) { Logger.Verbose("Calling Close"); await Coroutine.Sleep(2000); DeepDungeonResult.Instance.SendAction(1, 3, uint.MaxValue); DeepTracker.EndRun(false); } await Coroutine.Wait(TimeSpan.MaxValue, () => DeepDungeonCombined.StopPlz || QuestLogManager.InCutscene || NowLoading.IsVisible); return(true); } if (Target.Unit != null && Target.Unit.IsValid) { Blacklist.Add(Target.Unit.ObjectId, TimeSpan.FromMinutes(5), $"Tried to Interact with the Target {tries} times"); } Poi.Clear($"Tried to Interact with the Target {tries} times"); return(false); }