Example #1
0
        public async Task <bool> Run()
        {
            if (MoveTimer.IsFinished && (Poi.Current != null && Poi.Current.Type != PoiType.None))
            {
                var path = StraightPathHelper.RealStraightPath();
                Logger.Info($"Dump path:");
                foreach (var x in path)
                {
                    Logger.Info(x.ToString());
                }

                Logger.Warn("No activity was detected for {0} seconds. Clearing POI and trying again.", MoveTimer.WaitTime.TotalSeconds);
                Poi.Clear("No activity detected");
                MoveTimer.Reset();
                return(true);
            }
            else if (MoveTimer.IsFinished)
            {
                Logger.Warn("No activity was detected for {0} seconds. Clearing Navigator?", MoveTimer.WaitTime.TotalSeconds);
                await CommonTasks.StopMoving();

                Navigator.Clear();
                MoveTimer.Reset();
                return(true);
            }

            return(false);
        }
Example #2
0
        public async Task <bool> Run()
        {
            if (MoveTimer.IsFinished && (Poi.Current != null && Poi.Current.Type != PoiType.None))
            {
                var path = StraightPathHelper.RealStraightPath();
                Logger.Info($"Dump path:");
                foreach (var x in path)
                {
                    Logger.Info(x.ToString());
                }

                Logger.Warn("No activity was detected for {0} seconds. Adding target to the blacklist and trying again", MoveTimer.WaitTime.TotalSeconds);
                if (Poi.Current.Unit != null)
                {
                    DDTargetingProvider.Instance.AddToBlackList(Poi.Current.Unit, TimeSpan.FromSeconds(3), "Navigation Error");
                }
                if (Poi.Current.Type != PoiType.None)
                {
                    Poi.Clear("No activity detected");
                }

                MoveTimer.Reset();
                return(true);
            }
            else if (MoveTimer.IsFinished)
            {
                Logger.Warn("No activity was detected for {0} seconds. Clearing Navigator?", MoveTimer.WaitTime.TotalSeconds);
                await CommonTasks.StopMoving();

                Navigator.Clear();
                MoveTimer.Reset();
                return(true);
            }

            return(false);
        }