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);
        }
Exemple #3
0
        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 ExplorerService(ILifetimeScope scope)
        {
            _scope = scope ?? throw new ArgumentNullException(nameof(scope));

            _logger            = LogManager.GetCurrentClassLogger();
            ExplorerViewModels = new ObservableCollection <ExplorerViewModel>();

            _tracker = DeepTracker.Setup(ExplorerViewModels)
                       .Include <IExplorerSerializableProperties>()
                       .Subscribe <ChangedEventArgs>(OnChangedEvent)
                       .Create()
                       .Activate();
        }
Exemple #5
0
        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 SplitMenuButton()
 {
     AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(ClickEventHandler));
     AddHandler(ToggleButton.CheckedEvent, new RoutedEventHandler(CheckedUncheckedEventHandler));
     AddHandler(ToggleButton.UncheckedEvent, new RoutedEventHandler(CheckedUncheckedEventHandler));
     AddHandler(MenuItem.ClickEvent, new RoutedEventHandler(MenuItemClickEventHandler));
     Items = new FreezableCollection <DependencyObject>();
     _itemsSourcePropertyChangedTracker = DeepTracker.Setup(this)
                                          .Include(Route.Create(nameof(ItemsSource)))
                                          .Include(Route.Create(nameof(Items)))
                                          .Subscribe <ObjectAttachedEventArgs>(ItemsCollectionChanged)
                                          .Create()
                                          .Activate();
 }
Exemple #7
0
        public CommandService()
        {
            _activations     = new ObjectsStorage <object, EventHandlerSubscriptionStorage>(ComponentSubscriptionActivationFactory);
            _trackerRegistry = new ObservableCollection <CommandServiceComponent>();
            _viewRegistry    = new ObservableCollection <CommandServiceComponent>();
            _metadata        = new MutableLookup <object, ComponentMetadata>();

            _componentsTracker = DeepTracker.Setup(_trackerRegistry)
                                 .Subscribe <ObjectAttachmentEventArgs>(OnObjectAttachmentEvent)
                                 .Subscribe <ChangedPropertyEventArgs>(OnChangedPropertyEvent)
                                 .Include <CommandServiceComponent>(instance => instance.Id)
                                 .Include <CommandBundle>(instance => instance.Groups)
                                 .Include <CommandBundle>(instance => instance.Context)
                                 .Include <CommandGroup>(instance => instance.Commands)
                                 .Include <CommandServiceCommand>(instance => instance.Commands)
                                 .Create()
                                 .Activate();
        }
        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);
        }
Exemple #9
0
        public override void Start()
        {
            Poi.Current = null;

            if (DutyManager.InInstance && !Constants.SelectedDungeon.DeepDungeonRawIds.Contains(WorldManager.ZoneId))
            {
                Constants.SelectedDungeon             = Constants.GetDeepDungeonByMapid(WorldManager.ZoneId);
                Settings.Instance.BetterSelectedLevel = Constants.SelectedDungeon.Floors.FirstOrDefault(i => i.MapId == WorldManager.ZoneId);
                Logger.Warn($"Started bot inside dungeon (Not currently selected): Using {Constants.SelectedDungeon.DisplayName}");
            }

            if (Constants.SelectedDungeon == null)
            {
                Logger.Error("No Selected Deep Dungeon: Something went really wrong");
                _root = new ActionAlwaysFail();
                return;
            }

            if (Settings.Instance.BetterSelectedLevel == null)
            {
                Settings.Instance.BetterSelectedLevel = Constants.SelectedDungeon.Floors[0];
                Logger.Error($"No floor selected, setting it to use [{Settings.Instance.BetterSelectedLevel.DisplayName}]");
            }

            Logger.Info(Constants.SelectedDungeon.ToString());
            //setup navigation manager
            Navigator.NavigationProvider = new DDNavigationProvider(new ServiceNavigationProvider());
            Navigator.PlayerMover        = new SlideMover();

            TreeHooks.Instance.ClearAll();

            DeepTracker.InitializeTracker(Core.Me.ClassLevel);

            _tasks = new TaskManagerProvider();


            _tasks.Add(new LoadingHandler());
            _tasks.Add(new DeathWindowHandler());
            _tasks.Add(new SideStepTask());
            //not sure if i want the trap handler to be above combat or not
            _tasks.Add(new TrapHandler());

            //pomanders for sure need to happen before combat so that we can correctly apply Lust for bosses
            _tasks.Add(new Pomanders());

            _tasks.Add(new CombatHandler());

            _tasks.Add(new LobbyHandler());
            _tasks.Add(new GetToCaptain());
            _tasks.Add(new POTDEntrance());


            _tasks.Add(new CairnOfReturn());
            _tasks.Add(new FloorExit());
            _tasks.Add(new Loot());


            _tasks.Add(new StuckDetection());
            _tasks.Add(new POTDNavigation());


            _tasks.Add(new BaseLogicHandler());

            Settings.Instance.Stop = false;
            if (!Core.Me.IsDow())
            {
                Logger.Error("Please change to a DOW class");
                _root = new ActionAlwaysFail();
                return;
            }

            Logger.Error($"DeepDungeon status agent id {DeepDungeonStatus.Agent}");


            //setup combat manager
            CombatTargeting.Instance.Provider = new DDCombatTargetingProvider();

            GameSettingsManager.FaceTargetOnAction = true;


            if (Constants.Lang == Language.Chn)
            {
                //回避 - sidestep
                //Zekken
                if (PluginManager.Plugins.Any(i => (i.Plugin.Name.Contains("Zekken") || i.Plugin.Name.Contains("技能躲避")) && i.Enabled))
                {
                    Logger.Error("禁用 AOE技能躲避插件 - Zekken");
                    _root = new ActionAlwaysFail();
                    return;
                }
            }

            if (PluginManager.Plugins.Any(i => i.Plugin.Name == "Zekken" && i.Enabled))
            {
                Logger.Error(
                    "Zekken is currently turned on, It will interfere with DeepDive & SideStep. Please Turn it off and restart the bot.");
                _root = new ActionAlwaysFail();
                return;
            }


            if (!ConditionParser.IsQuestCompleted(Constants.SelectedDungeon.UnlockQuest))
            {
                Logger.Error($"You must complete \"{DataManager.GetLocalizedQuestName(Constants.SelectedDungeon.UnlockQuest)}\" to run this base.");
                Logger.Error(
                    "Please switch to \"Order Bot\" and run the profile: \\BotBases\\DeepDive\\Profiles\\PotD_Unlock.xml");
                _root = new ActionAlwaysFail();
                return;
            }

            if (!ConditionParser.IsQuestCompleted(Settings.Instance.BetterSelectedLevel.QuestId))
            {
                Logger.Error($"You must complete \"{DataManager.GetLocalizedQuestName(Settings.Instance.BetterSelectedLevel.QuestId)}\" to run this floor.");
                Logger.Error("Complete the quest or change the floor selection");
                _root = new ActionAlwaysFail();
                return;
            }

            //Logger.Error($"Quest {Settings.Instance.BetterSelectedLevel.QuestId} - \"{DataManager.GetLocalizedQuestName(Settings.Instance.BetterSelectedLevel.QuestId)}\" to run this base.");

            StopPlz = false;

            SetupSettings();

            _root =
                new ActionRunCoroutine(async x =>
            {
                if (StopPlz)
                {
                    return(false);
                }
                if (!_init)
                {
                    Logging.Write("DeepDive is waiting on Initialization to finish");
                    return(true);
                }

                if (await _tasks.Run())
                {
                    await Coroutine.Yield();
                }
                else
                {
                    Logger.Warn("No tasks ran");
                    await Coroutine.Sleep(1000);
                }

                return(true);
            });
        }
Exemple #10
0
        /// <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);
        }
Exemple #11
0
        public override void Start()
        {
            Poi.Current = null;
            //setup navigation manager
            Navigator.NavigationProvider = new DDNavigationProvider(new ServiceNavigationProvider());
            Navigator.PlayerMover        = new SlideMover();

            TreeHooks.Instance.ClearAll();

            _tasks = new TaskManagerProvider();

            DeepTracker.InitializeTracker(Core.Me.ClassLevel);

            _tasks.Add(new LoadingHandler());
            _tasks.Add(new DeathWindowHandler());
            _tasks.Add(new SideStepTask());
            //not sure if i want the trap handler to be above combat or not
            _tasks.Add(new TrapHandler());

            //pomanders for sure need to happen before combat so that we can correctly apply Lust for bosses
            _tasks.Add(new Pomanders());

            _tasks.Add(new CombatHandler());
            _tasks.Add(new LobbyHandler());

            _tasks.Add(new GetToCaptiain());
            _tasks.Add(new POTDEntrance());

            _tasks.Add(new CarnOfReturn());
            _tasks.Add(new FloorExit());
            _tasks.Add(new Loot());

            _tasks.Add(new StuckDetection());
            _tasks.Add(new POTDNavigation());

            _tasks.Add(new BaseLogicHandler());

            Settings.Instance.Stop = false;
            if (!Core.Me.IsDow())
            {
                Logger.Error("Please change to a DOW class");
                _root = new ActionAlwaysFail();
                return;
            }

            //setup combat manager
            CombatTargeting.Instance.Provider = new DDCombatTargetingProvider();

            GameSettingsManager.FaceTargetOnAction = true;

            if (Constants.Lang == Language.Chn)
            {
                //回避 - sidestep
                //Zekken
                if (PluginManager.Plugins.Any(i =>
                                              (i.Plugin.Name.Contains("Zekken") || i.Plugin.Name.Contains("技能躲避")) && i.Enabled))
                {
                    Logger.Error("禁用 AOE技能躲避插件 - Zekken");
                    _root = new ActionAlwaysFail();
                    return;
                }
            }

            if (PluginManager.Plugins.Any(i => i.Plugin.Name == "Zekken" && i.Enabled))
            {
                Logger.Error(
                    "Zekken is currently turned on, It will interfere with DeepDive & SideStep. Please Turn it off and restart the bot.");
                _root = new ActionAlwaysFail();
                return;
            }

            if (!ConditionParser.IsQuestCompleted(67092))
            {
                Logger.Error("You must complete \"The House That Death Built\" to run this base.");
                Logger.Error(
                    "Please switch to \"Order Bot\" and run the profile: \\BotBases\\DeepDive\\Profiles\\PotD_Unlock.xml");
                _root = new ActionAlwaysFail();
                return;
            }

            StopPlz = false;

            SetupSettings();

            if (ShowDebug)
            {
                if (_debug == null)
                {
                    // _debug = new Debug
                    // {
                    //Text = "DeepDive2 v" + v //title
                    // };
                    try
                    {
                        //_debug = new Form1();

                        Thread Messagethread = new Thread(new ThreadStart(delegate()
                        {
                            _debug = new Form1();

                            /* DispatcherOperation DispacherOP =
                             * _debug.Dispatcher.BeginInvoke(
                             *   DispatcherPriority.Normal,
                             *   new System.Action(delegate ()
                             *   {
                             *       _debug.Show();
                             *       _debug.Closed += (o, e) => { _debug = null; };
                             *   }));
                             *
                             * _debug.BeginInvoke(
                             * new System.Action(delegate ()
                             * {
                             * // _debug.Show();
                             * _debug.ShowDialog();
                             * _debug.Closed += (o, e) => { _debug = null; };
                             * }));
                             * // _debug.Show();
                             */
                            _debug.ShowDialog();

                            //_debug.listBox1.DataSource = DDTargetingProvider.Instance.LastEntities;
                        }));
                        Messagethread.SetApartmentState(ApartmentState.STA);
                        Messagethread.Start();

                        // _debug.Show(); _debug.listBox1.DataSource = DDTargetingProvider.Instance.LastEntities;
                        //_debug.ShowDialog();
                        DeepTracker._debug = _debug;
                    }
                    catch (Exception)
                    { }
                }
            }

            _root =
                new ActionRunCoroutine(async x =>
            {
                if (StopPlz)
                {
                    return(false);
                }
                if (!_init)
                {
                    Logging.Write("DeepDive is waiting on Initialization to finish");
                    return(true);
                }

                if (await _tasks.Run())
                {
                    await Coroutine.Yield();
                }
                else
                {
                    Logger.Warn("No tasks ran");
                    await Coroutine.Sleep(1000);
                }

                return(true);
            });
        }
Exemple #12
0
        public override void Start()
        {
            Poi.Current = null;
            //setup navigation manager
            Navigator.NavigationProvider = new DDNavigationProvider(new ServiceNavigationProvider());
            Navigator.PlayerMover        = new SlideMover();

            TreeHooks.Instance.ClearAll();

            _tasks = new TaskManagerProvider();

            DeepTracker.InitializeTracker(Core.Me.ClassLevel);

            _tasks.Add(new LoadingHandler());
            _tasks.Add(new DeathWindowHandler());
            _tasks.Add(new SideStepTask());
            //not sure if i want the trap handler to be above combat or not
            _tasks.Add(new TrapHandler());

            //pomanders for sure need to happen before combat so that we can correctly apply Lust for bosses
            _tasks.Add(new Pomanders());

            _tasks.Add(new CombatHandler());

            _tasks.Add(new LobbyHandler());
            _tasks.Add(new GetToKyusei());
            _tasks.Add(new POTDEntrance());

            _tasks.Add(new BeaconOfReturn());
            _tasks.Add(new FloorExit());
            _tasks.Add(new Loot());

            _tasks.Add(new StuckDetection());
            _tasks.Add(new POTDNavigation());

            _tasks.Add(new BaseLogicHandler());

            Settings.Instance.Stop = false;
            if (!Core.Me.IsDow())
            {
                Logger.Error("Please change to a DOW class");
                _root = new ActionAlwaysFail();
                return;
            }

            //setup combat manager
            CombatTargeting.Instance.Provider = new DDCombatTargetingProvider();

            GameSettingsManager.FaceTargetOnAction = true;

            if (Constants.Lang == Language.Chn)
            {
                if (PluginManager.Plugins.Any(i =>
                                              (i.Plugin.Name.Contains("Zekken") || i.Plugin.Name.Contains("技能躲避")) && i.Enabled))
                {
                    Logger.Error("禁用 AOE技能躲避插件 - Zekken");
                    _root = new ActionAlwaysFail();
                    return;
                }
            }

            if (PluginManager.Plugins.Any(i => i.Plugin.Name == "Zekken" && i.Enabled))
            {
                Logger.Error(
                    "Zekken is currently turned on, It will interfere with DeepDive & SideStep. Please Turn it off and restart the bot.");
                _root = new ActionAlwaysFail();
                return;
            }

            if (!ConditionParser.IsQuestCompleted(67092))
            {
                Logger.Error("You must complete \"The House That Death Built\" to run this base.");
                Logger.Error(
                    "Please switch to \"Order Bot\" and run the profile: \\BotBases\\DeepDive\\Profiles\\PotD_Unlock.xml");
                _root = new ActionAlwaysFail();
                return;
            }

            StopPlz = false;

            SetupSettings();

            _root =
                new ActionRunCoroutine(async x =>
            {
                if (StopPlz)
                {
                    return(false);
                }

                if (!_init)
                {
                    ff14bot.Helpers.Logging.Write("DeepDive is waiting on Initialization to finish");
                    return(true);
                }

                if (await _tasks.Run())
                {
                    await Coroutine.Yield();
                }
                else
                {
                    Logger.Warn("No tasks ran");
                    await Coroutine.Sleep(1000);
                }

                return(true);
            });
        }