예제 #1
0
        private bool NotStarted()
        {
            State = States.Clearing;

            _currentDestination = ActorFinder.FindNearestHostileUnitInRadius(_center, _radius);
            if (_currentDestination == Vector3.Zero && !_forceMoveAround)
            {
                State = States.Completed;
                return(false);
            }

            if (_forceMoveAround)
            {
                // Desperate Measures
                _forceClearDestinations =
                    new ConcurrentBag <Vector3>(
                        ExplorationHelpers.GetFourPointsInEachDirection(_center, _radius).Where(d => d != Vector3.Zero));
                Logger.Debug("[ClearArea] No actors found in the area, using the desperate measures.");
                State = States.ForceClearing;
                if (_forceClearDestinations.TryTake(out _currentDestination))
                {
                    return(false);
                }
                Logger.Error("[ClearArea] Couldn't get force clear destinations, ending tag.");
                State = States.Completed;
                return(true);
            }


            return(false);
        }
예제 #2
0
        internal static void InstallButtons()
        {
            Window mainWindow;

            Application.Current.Dispatcher.Invoke(
                () =>
            {
                try
                {
                    mainWindow = Application.Current.MainWindow;
                    var tabs   = mainWindow.FindName("tabControlMain") as TabControl;
                    if (tabs == null)
                    {
                        return;
                    }
                    var mainTab  = (TabItem)tabs.Items[0];
                    _mainTabGrid = (Grid)mainTab.Content;
                    if (_configureAdventurerButton == null)
                    {
                        //_toggleAdventurerStateButton = CreateToggleButton();
                        _configureAdventurerButton = CreateConfigureButton();
                        //_mainTabGrid.Children.Add(_toggleAdventurerStateButton);
                        _mainTabGrid.Children.Add(_configureAdventurerButton);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("[MainUI][InstallButtons] " + ex.Message);
                }
            });
        }
예제 #3
0
 internal static void RemoveButtons()
 {
     Application.Current.Dispatcher.Invoke(
         () =>
     {
         try
         {
             if (_configureAdventurerButton != null)
             {
                 _configureAdventurerButton.Visibility = Visibility.Collapsed;
             }
         }
         catch (Exception ex)
         {
             Logger.Error("[MainUI][RemoveButtons] " + ex.Message);
         }
     });
 }
예제 #4
0
        private static void Configure_Click(object sender, RoutedEventArgs e)
        {
            var instance = ConfigWindow.Instance;

            if (instance != null)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    try
                    {
                        instance.ShowDialog();
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("[MainUI][Configure] " + ex.Message);
                    }
                });
            }
        }
예제 #5
0
        public override void OnStart()
        {
            if (!Adventurer.Enabled)
            {
                Logger.Error("Plugin is not enabled. Please enable Adventurer and try again.");
                _isDone = true;
                return;
            }

            PluginEvents.CurrentProfileType = ProfileType.Keywarden;
            if (_keywardenCoroutine == null)
            {
                var keywardenData = GetNext();
                if (keywardenData != null)
                {
                    _keywardenCoroutine = new KeywardenCoroutine(keywardenData);
                }
                else
                {
                    Logger.Info("[Keywardens] Uhm. No eligible keywardens to cook, remaking the game.");
                    _isDone = true;
                }
            }
        }
 private async Task <bool> InteractingWithTyrael()
 {
     if (await _interactionCoroutine.GetCoroutine())
     {
         if (!ZetaDia.ActInfo.AllQuests.Any(q => q.Quest == BountyHelpers.ActBountyFinishingQuests[_act] && q.State == QuestState.InProgress))
         {
             State = States.Completed;
             return(false);
         }
         var tyrael = ActorFinder.FindUnit(TYRAEL);
         if (tyrael == null)
         {
             Logger.Error("[CompleteActBounties] Couldn't detect Tyrael. Failing");
             State = States.Failed;
             return(false);
         }
         if (tyrael.IsFullyValid() && tyrael.CommonData.MarkerType == MarkerType.Exclamation)
         {
             return(false);
         }
         State = States.Completed;
     }
     return(false);
 }