public static void Execute() { if (LastRun > Environment.TickCount) { return; } if (!Player.Instance.IsInShopRange() && Player.Instance.CountEnemiesInRange(Misc.RangeEnemy) >= Misc.EnemyCount) { if (Settings.UseHPpot && HealthPotion.IsOwned()) { if (Player.Instance.HealthPercent < Settings.MinHPpot && !Player.Instance.HasBuff("RegenerationPotion")) { HealthPotion.Cast(); } } if (Settings.UseBiscuits && Biscuit.IsOwned()) { if (Player.Instance.ManaPercent <= Settings.MinBiscuitMp && Player.Instance.HealthPercent <= Settings.MinBiscuitHp && !Player.Instance.HasBuff("ItemMiniRegenPotion")) { Biscuit.Cast(); } } if (Settings.UseRefillPOT && RefillablePotion.IsOwned()) { if (Player.Instance.HealthPercent <= Settings.MinRefillHp && !Player.Instance.HasBuff("ItemCrystalFlask")) { RefillablePotion.Cast(); } } if (Settings.UseCorrupts && CorruptingPotion.IsOwned()) { if (Player.Instance.ManaPercent < Settings.MinCorruptMp && Player.Instance.HealthPercent < Settings.MinCorruptHp && !Player.Instance.HasBuff("ItemDarkCrystalFlask")) { CorruptingPotion.Cast(); } } if (Settings.UseHunters && HuntersPotion.IsOwned()) { if (Player.Instance.ManaPercent < Settings.MinHunterMp && Player.Instance.HealthPercent < Settings.MinHunterHp && !Player.Instance.HasBuff("ItemCrystalFlaskJungle")) { HuntersPotion.Cast(); } } LastRun = Environment.TickCount + 1000; } }
private static void Potions() { if (ObjectManager.GetLocalPlayer().IsDead || ObjectManager.GetLocalPlayer().IsInFountainRange() || ObjectManager.GetLocalPlayer().HasBuff("recall")) { return; } if (!AutoPotionsMenu["SharpShooter.UtilityMenu.AutoPotionsMenu.Enabled"].Enabled || ObjectManager.GetLocalPlayer().HealthPercent() > AutoPotionsMenu["SharpShooter.UtilityMenu.AutoPotionsMenu.MyHp"].Value || ObjectManager.GetLocalPlayer().CountEnemyHeroesInRange(1200) <= 0) { return; } if (ObjectManager.GetLocalPlayer().Buffs.Any(x => x != null && buffName.Contains(x.Name.ToLower()) && x.IsActive)) { return; } if (HealthPotion != null && HealthPotion.IsMine && HealthPotion.Ready) { HealthPotion.Cast(); } else if (TotalBiscuitofRejuvenation != null && TotalBiscuitofRejuvenation.IsMine && TotalBiscuitofRejuvenation.Ready) { TotalBiscuitofRejuvenation.Cast(); } else if (RefillablePotion != null && RefillablePotion.IsMine && RefillablePotion.Ready) { RefillablePotion.Cast(); } else if (HuntersPotion != null && HuntersPotion.IsMine && HuntersPotion.Ready) { HuntersPotion.Cast(); } else if (CorruptingPotion != null && CorruptingPotion.IsMine && CorruptingPotion.Ready) { CorruptingPotion.Cast(); } }