Exemple #1
0
        public static bool AttackUnit(Unit unit, TimeSpan timeout)
        {
            if (Sherpa.GetBool(() => unit.Life <= 0))
            {
                return(false);
            }

            var startTime = TimeSpan.FromTicks(Environment.TickCount);


            while (Sherpa.GetBool(() => unit.Life > 0))
            {
                if (!Secondary.Use(unit))
                {
                    Primary.Use(unit);
                }

                Thread.Sleep(200);

                if (TimeSpan.FromTicks(Environment.TickCount).Subtract(startTime) > timeout)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
        public static void SalvageItems()
        {
            UIElement salvgUI = null;

            while (salvgUI == null || !salvgUI.Visible)
            {
                salvgUI =
                    Sherpa.GetData(
                        () =>
                        UIElement.Get().Where(
                            x => x.Name.Contains("Root.NormalLayer.vendor_dialog_mainPage.salvage_dialog")).
                        FirstOrDefault());
            }


            var items = Sherpa.GetData(() => Me.GetContainerItems(Container.Inventory).Where(CheckItemSalvage).ToArray());

            Snowshoes.Print(string.Format("Salvaging {0} items", items.Count()));
            foreach (var i in items)
            {
                Unit i1 = i;
                Sherpa.GetBool(i1.SalvageItem);
                Thread.Sleep(Game.Ping);
            }
        }
Exemple #3
0
 public bool Use()
 {
     return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id)));
 }
Exemple #4
0
 public bool Use(float x, float y)
 {
     return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id, x, y, Me.Z)));
 }
Exemple #5
0
 public bool Use(Unit target)
 {
     return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id, target)));
 }
Exemple #6
0
 public bool IsAvailableNow()
 {
     return(Sherpa.GetBool(
                () => Me.PrimaryResource >= PrimCost && Me.SecondaryResource >= SecCost && Me.IsSkillReady(Id)));
 }