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); }
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); } }
public bool Use() { return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id))); }
public bool Use(float x, float y) { return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id, x, y, Me.Z))); }
public bool Use(Unit target) { return(IsAvailableNow() && Sherpa.GetBool(() => Me.UsePower(Id, target))); }
public bool IsAvailableNow() { return(Sherpa.GetBool( () => Me.PrimaryResource >= PrimCost && Me.SecondaryResource >= SecCost && Me.IsSkillReady(Id))); }