static void Game_OnGameUpdate(EventArgs args) { // Update the notification NotificationHandler.Update(); if (!(Menu.Item("Enabled").IsActive() || Menu.Item("EnabledKeybind").IsActive())) { return; } // Sort the spells var index = Menu.Item("SortRule").GetValue <StringList>().SelectedValue; switch (index) { case "Most Damage": Spells = Spells.OrderByDescending(x => x.GetDamage(Player)).ToList(); break; case "Least Damage": Spells = Spells.OrderBy(x => x.GetDamage(Player)).ToList(); break; case "Biggest Range": Spells = Spells.OrderByDescending(x => x.Range).ToList(); break; case "Smallest Range": Spells = Spells.OrderBy(x => x.Range).ToList(); break; case "Smallest Cast Time": Spells = Spells.OrderBy(x => x.Delay).ToList(); break; } // Get baron if (Baron != null && Baron.IsValid && Baron.Health > 0) { foreach (var spell in Spells.Where(x => x.IsReady() && x.IsInRange(Baron, x.Range) && SkillEnabled("Steal", x.Slot))) { var time = (1000 * Player.Distance(Baron) / spell.Speed) + spell.Delay * 1000 + Game.Ping / 2f; var healthPrediciton = HealthPrediction.GetHealthPrediction(Baron, (int)time); if (!(spell.GetDamage(Baron) > Baron.Health)) { continue; } spell.Cast(Baron.ServerPosition); break; } } // Get dragon if (Dragon != null && Dragon.IsValid && Dragon.Health > 0) { foreach (var spell in Spells.Where(x => x.IsReady() && x.IsInRange(Dragon, x.Range) && SkillEnabled("Steal", x.Slot))) { var time = (1000 * Player.Distance(Dragon) / spell.Speed) + spell.Delay * 1000 + Game.Ping / 2f; var healthPrediciton = HealthPrediction.GetHealthPrediction(Dragon, (int)time); if (!(spell.GetDamage(Dragon) > Dragon.Health)) { continue; } spell.Cast(Dragon.ServerPosition); break; } } // Get Blue foreach (var blue in Blues.Where(x => x.IsValid && x.Health > 0)) { var blue1 = blue; foreach (var spell in Spells.Where(x => x.IsReady() && x.IsInRange(blue1, x.Range) && SkillEnabled("Buff", x.Slot))) { var time = (1000 * Player.Distance(blue) / spell.Speed) + spell.Delay * 1000 + Game.Ping / 2f; var healthPrediciton = HealthPrediction.GetHealthPrediction(blue, (int)time); if (!(spell.GetDamage(blue) > blue.Health)) { continue; } spell.Cast(blue.ServerPosition); break; } } // Get Red foreach (var red in Reds.Where(x => x.IsValid && x.Health > 0)) { var red1 = red; foreach (var spell in Spells.Where(x => x.IsReady() && x.IsInRange(red1, x.Range) && SkillEnabled("Buff", x.Slot))) { var time = (1000 * Player.Distance(red) / spell.Speed) + spell.Delay * 1000 + Game.Ping / 2f; var healthPrediciton = HealthPrediction.GetHealthPrediction(red, (int)time); if (!(spell.GetDamage(red) > red.Health)) { continue; } spell.Cast(red.ServerPosition); break; } } // Kill SECURE foreach (var hero in HeroManager.Enemies.Where(x => x.IsValidTarget())) { var hero1 = hero; foreach (var spell in Spells.Where(x => x.IsReady() && x.IsInRange(hero1, x.Range) && SkillEnabled("KS", x.Slot))) { var time = (1000 * Player.Distance(hero) / spell.Speed) + spell.Delay * 1000 + Game.Ping / 2f; var healthPrediciton = HealthPrediction.GetHealthPrediction(hero, (int)time); if (!(spell.GetDamage(hero) > hero.Health)) { continue; } spell.Cast(hero.ServerPosition); break; } } }