public async Task <IActionResult> Edit(int id, [Bind("HitchClass,WeightRatingPounds,ProductID,BrandID,ProductTypeID,ProductName,ProductDescription,VehicleModel,ProductCode,Price,InStock")] Hitch hitch) { if (id != hitch.ProductID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hitch); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HitchExists(hitch.ProductID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BrandID"] = new SelectList(_context.Brands, "BrandID", "BrandName", hitch.BrandID); ViewData["ProductTypeID"] = new SelectList(_context.ProductTypes, "ProductTypeID", "ProductTypeName", hitch.ProductTypeID); return(View(hitch)); }
public static void Execute() { var target = TargetSelector.GetTarget(Q2.Range, DamageType.Mixed); if (target == null) { return; } var targetW = TargetSelector.GetTarget(Player.Instance.BoundingRadius + 175, DamageType.Physical); var targetQ2 = TargetSelector.GetTarget(850, DamageType.Magical); var predq2 = Q2.GetPrediction(targetQ2).HitChance >= Hitch.hitchance(Q2, FirstMenu); var targetE = TargetSelector.GetTarget(550, DamageType.Physical); var targetE2 = TargetSelector.GetTarget(E2.Range, DamageType.Physical); if (HarassMenu.GetCheckBoxValue("qUse") && Q.IsReady() && targetE.IsValidTarget(100)) { Q.Cast(); } if (HarassMenu.GetCheckBoxValue("eUse") && E.IsReady()) { E.Cast(targetE); } if (HarassMenu.GetCheckBoxValue("q2Use") && Q2.IsReady() && predq2) { var predQ2 = SpellsManager.Q2.GetPrediction(targetQ2); Q2.Cast(predQ2.CastPosition); } }
public static void Execute() { //////////////////// KS E BETA var targetKSE = TargetSelector.GetTarget(SpellsManager.E.Range, DamageType.Magical); if (targetKSE != null && KillStealMenu.GetCheckBoxValue("eUse") && SpellsManager.E.IsReady()) { var predE2 = SpellsManager.E.GetPrediction(targetKSE); if (predE2.HitChance >= HitChance.High && targetKSE.Health < Player.Instance.GetSpellDamage(targetKSE, SpellSlot.E)) { SpellsManager.E.Cast(predE2.CastPosition); return; } }//////////////////// END KS E //////////////////// KS R BETA var targetKSR = TargetSelector.GetTarget(SpellsManager.R.Range, DamageType.Magical); if (targetKSR != null && KillStealMenu.GetCheckBoxValue("rUse") && SpellsManager.R.IsReady()) { var predR2 = SpellsManager.R.GetPrediction(targetKSR); if (predR2.HitChance >= HitChance.High && targetKSR.Health < Player.Instance.GetSpellDamage(targetKSR, SpellSlot.R)) { SpellsManager.R.Cast(predR2.CastPosition); return; } }//////////////////// END KS R if (Player.Instance.InDanger(95) && W.IsReady() && (Hitch.ShouldOverload(SpellSlot.W) || Player.Instance.Mana < 80)) //Credits Mario { W.Cast(); } }
public async Task <IActionResult> Create([Bind("HitchClass,WeightRatingPounds,ProductID,BrandID,ProductTypeID,ProductName,ProductDescription,VehicleModel,ProductCode,Price,InStock")] Hitch hitch) { if (ModelState.IsValid) { _context.Add(hitch); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BrandID"] = new SelectList(_context.Brands, "BrandID", "BrandName", hitch.BrandID); ViewData["ProductTypeID"] = new SelectList(_context.ProductTypes, "ProductTypeID", "ProductTypeName", hitch.ProductTypeID); return(View(hitch)); }
public static void Execute() { var etarget = TargetSelector.GetTarget(E.Range, DamageType.Magical); if (W.IsReady() && Q.IsReady()) { Q.Cast(); W.Cast(); } if (E.IsReady() && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(etarget.Position); } }
public static void Execute() { //////////////////// KS Q2 if (KillStealMenu.GetCheckBoxValue("qUse")) { var q2target = TargetSelector.GetTarget(Q2.Range, DamageType.Magical); if (q2target == null) { return; } if (Q.IsReady()) { var q2Damage = q2target.GetDamage(SpellSlot.Q); var predictedHealth = Prediction.Health.GetPrediction(q2target, Q2.CastDelay + Game.Ping); if (predictedHealth <= q2Damage && Q2.GetPrediction(q2target).HitChance >= Hitch.hitchance(Q2, FirstMenu)) { var rangi = TargetSelector.GetTarget(Program._player.GetAutoAttackRange(), DamageType.Physical); if (q2target.IsValidTarget(Q2.Range)) { Q2.Cast(q2target); } } } } //////////////////// END KS Q2 //////////////////// KS E2 if (KillStealMenu.GetCheckBoxValue("eUse")) { var e2target = TargetSelector.GetTarget(E2.Range, DamageType.Magical); if (e2target == null) { return; } if (E2.IsReady()) { var e2Damage = e2target.GetDamage(SpellSlot.E); var predictedHealth = Prediction.Health.GetPrediction(e2target, E2.CastDelay + Game.Ping); if (predictedHealth <= e2Damage && E2.GetPrediction(e2target).HitChance >= Hitch.hitchance(E2, FirstMenu)) { var rangi = TargetSelector.GetTarget(Program._player.GetAutoAttackRange(), DamageType.Physical); if (e2target.IsValidTarget(E2.Range)) { E2.Cast(e2target); } } } } //////////////////// END KS E2 //////////////////// KS Q2 var targetKSQ2 = TargetSelector.GetTarget(SpellsManager.Q2.Range, DamageType.Magical); if (targetKSQ2 != null && Program.burrowed && KillStealMenu.GetCheckBoxValue("qUse") && SpellsManager.Q2.IsReady()) { var predQ2 = SpellsManager.Q2.GetPrediction(targetKSQ2); if (predQ2.HitChance >= HitChance.High && targetKSQ2.Health < Player.Instance.GetSpellDamage(targetKSQ2, SpellSlot.Q)) { SpellsManager.Q2.Cast(predQ2.CastPosition); return; } }//////////////////// END KS Q2 }
public static void Execute() { //W autodisable thanks to Sunnyline2 if (MiscMenu.GetCheckBoxValue("smartW") && Program.WStatus()) { int monsters = EntityManager.MinionsAndMonsters.CombinedAttackable.Where(monster => monster.IsValidTarget(W.Range * 2)).Count(); int enemies = EntityManager.Heroes.Enemies.Where(enemy => enemy.IsValidTarget(W.Range * 2)).Count(); if (monsters == 0 && enemies == 0) { Program.WDisable(); } } //// Sunnyline2 //////////////////// KS Q var targetKSQ = TargetSelector.GetTarget(SpellsManager.Q.Range, DamageType.Magical); if (targetKSQ != null && KillStealMenu.GetCheckBoxValue("qUse") && SpellsManager.Q.IsReady()) { var predQ2 = SpellsManager.Q.GetPrediction(targetKSQ); if (predQ2.HitChance >= HitChance.High && targetKSQ.Health < Player.Instance.GetSpellDamage(targetKSQ, SpellSlot.Q)) { SpellsManager.Q.Cast(predQ2.CastPosition); return; } }//////////////////// END KS Q //////////////////// KS Q Logic #2 if (KillStealMenu.GetCheckBoxValue("qUse")) { var qtarget = TargetSelector.GetTarget(Q.Range, DamageType.Magical); if (qtarget == null) { return; } if (Q.IsReady()) { var qDamage = qtarget.GetDamage(SpellSlot.Q); var predictedHealth = Prediction.Health.GetPrediction(qtarget, Q.CastDelay + Game.Ping); if (predictedHealth <= qDamage && Q.GetPrediction(qtarget).HitChance >= Hitch.hitchance(Q, FirstMenu)) { var rangi = TargetSelector.GetTarget(Program._player.GetAutoAttackRange(), DamageType.Physical); if (qtarget.IsValidTarget(Q.Range)) { Q.Cast(qtarget); } } } } //////////////////// END Logic #2 }
public static void Execute() { var target = TargetSelector.GetTarget(1700, DamageType.Magical); if (target == null || target.IsInvulnerable || target.MagicImmune) { return; } Core.DelayAction(delegate { if (target.IsValidTarget(E.Range) && E.IsReady() && ComboMenu.GetCheckBoxValue("eUse") && (Hitch.ShouldOverload(SpellSlot.E) || Player.Instance.Mana < 80)) { E.Cast(target.Position); } }, Edelay); Core.DelayAction(delegate { if (Player.Instance.Spellbook.GetSpell(SpellSlot.E).ToggleState == 1) { E.Cast(target.Position); } }, Edelay); if (target.IsValidTarget(Q.Range) && Q.IsReady() && ComboMenu.GetCheckBoxValue("qUse") && Player.Instance.IsFacing(target) && (Hitch.ShouldOverload(SpellSlot.Q) || Player.Instance.Mana < 80)) { Q.Cast(); } if (W.IsReady() && ComboMenu.GetCheckBoxValue("wUse")) { W.Cast(); } var targetR = TargetSelector.GetTarget(R.Range, DamageType.Magical); if (targetR == null || targetR.IsZombie || targetR.HasUndyingBuff()) { return; } if (ComboMenu["rlog"].Cast <ComboBox>().CurrentValue == 0 && R.IsReady()) { if (targetR.IsMoving) { if (targetR.IsValidTarget(R.Range + 300)) { R.Cast(target.Position - target.MoveSpeed); } else { R.Cast(target.Position - target.MoveSpeed / 2); } } else if (R.IsReady() && targetR.IsValidTarget(R.Range + Q.Range) && ComboMenu["rlog"].Cast <ComboBox>().CurrentValue == 1 && !targetR.IsInRange(Player.Instance, E.Range) && !targetR.IsFacing(Player.Instance)) { if (ComboMenu.GetCheckBoxValue("rUse") && Prediction.Health.GetPrediction(targetR, R.CastDelay) <= SpellDamage.GetRealDamage(SpellSlot.R, targetR)) { Hitch.CastR(targetR, MiscMenu.GetSliderValue("minR")); } else { Hitch.CastR(targetR, MiscMenu.GetSliderValue("minR")); } } else if (ComboMenu["rlog"].Cast <ComboBox>().CurrentValue == 2 && R.IsReady()) { if (targetR.IsValidTarget(R.Range + Q.Range)) { var predr = R.GetPrediction(targetR); if (predr.HitChance >= HitChance.High) { R.Cast(predr.CastPosition - 40); } } else { var predictedHealth = Prediction.Health.GetPrediction(targetR, R.CastDelay + Game.Ping); var predr = R.GetPrediction(targetR); var rDamage = targetR.GetDamage(SpellSlot.R); if (predictedHealth <= rDamage) { R.Cast(predr.CastPosition); } } } } }
public static void Execute() { var target = TargetSelector.GetTarget(2000, DamageType.Physical); var rtarget = TargetSelector.GetTarget(R.Range, DamageType.Magical); var useQ = ComboMenu.GetCheckBoxValue("qUse"); var useW = ComboMenu.GetCheckBoxValue("wUse"); var useE = ComboMenu.GetCheckBoxValue("eUse"); var useR = ComboMenu.GetCheckBoxValue("rUse"); var useEE = ComboMenu.GetCheckBoxValue("UseEEC"); var tqq = TargetSelector.GetTarget(Q.Range, DamageType.Physical); if (useR) { Program.ItemsYuno(); R.Cast(); } if (_player.Mana <= 4) { var tqqq = TargetSelector.GetTarget(Q.Range, DamageType.Physical); if (tqqq.IsValidTarget(Q.Range) && Q.IsReady() && useQ) { Q.Cast(); Program.Items(); } var tww = TargetSelector.GetTarget(W.Range, DamageType.Magical); if (tww.IsValidTarget(250) && W.IsReady() && !_player.HasBuff("rengarpassivebuff") && useW) { W.Cast(); } var tee = TargetSelector.GetTarget(E.Range, DamageType.Physical); var predE = E.GetPrediction(tee); if (!_player.HasBuff("rengarpassivebuff") && tee.IsValidTarget(E.Range) && E.IsReady() && E.GetPrediction(tee).HitChance >= Hitch.hitchance(E, FirstMenu) && useE) { E.Cast(tee); } } if (_player.Mana <= 5) { var tq = TargetSelector.GetTarget(Q.Range, DamageType.Physical); var tw = TargetSelector.GetTarget(W.Range, DamageType.Magical); var te = TargetSelector.GetTarget(E.Range, DamageType.Physical); if (useQ && (FirstMenu.GetComboBoxValue("ComboPrio") == 0 && tq.IsValidTarget(Q.Range) && Q.IsReady()) || (FirstMenu.GetComboBoxValue("ComboPrio") == 2)) { Q.Cast(); } if (useW && FirstMenu.GetComboBoxValue("ComboPrio") == 1 && tw.IsValidTarget(250) && W.IsReady() && !_player.HasBuff("rengarpassivebuff")) { W.Cast(); } if (useE && FirstMenu.GetComboBoxValue("ComboPrio") == 2 && (te.IsValidTarget(E.Range) && E.IsReady() && !_player.HasBuff("rengarpassivebuff") && E.GetPrediction(te).HitChance >= Hitch.hitchance(E, FirstMenu))) { E.Cast(te); } if (useEE && !_player.HasBuff("RengarR") && te.IsValidTarget(E.Range) && E.IsReady() && E.GetPrediction(te).HitChance >= Hitch.hitchance(E, FirstMenu) && (FirstMenu.GetComboBoxValue("ComboPrio") == 2 || FirstMenu.GetComboBoxValue("ComboPrio") == 0)) { if (_player.Distance(te) > E.Range + 100f) { E.Cast(te); } } } if (MiscMenu.GetCheckBoxValue("AutoW")) { var HealthW = MiscMenu["AutoWHP"].Cast <Slider>().CurrentValue; if (W.IsReady() && _player.HealthPercent != HealthW && Player.Instance.Mana == 5) { W.Cast(); } } }
public static void Execute() { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var qtarget = TargetSelector.GetTarget(Q.Range, DamageType.Magical); var wtarget = TargetSelector.GetTarget(W.Range, DamageType.Magical); var etarget = TargetSelector.GetTarget(E.Range, DamageType.Magical); var rtarget = TargetSelector.GetTarget(3400, DamageType.Mixed); var target = TargetSelector.GetTarget(E.Range + 200, DamageType.Magical); var enemies = EntityManager.Heroes.Enemies.OrderByDescending(a => a.HealthPercent).Where(a => !a.IsMe && a.IsValidTarget() && a.Distance(_Player) <= R.Range); var predq = Q.GetPrediction(qtarget); if (target == null || target.IsInvulnerable || target.MagicImmune) { return; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // COMBO 1 if (ComboMenu["Comba"].Cast <ComboBox>().CurrentValue == 0) { Core.DelayAction(delegate { if (ComboMenu.GetCheckBoxValue("qUse") && Q.IsReady() && qtarget.IsValidTarget(Q.Range) && Q.GetPrediction(qtarget).HitChance >= Hitch.hitchance(Q, FirstMenu)) { Q.Cast(predq.CastPosition); } }, Qdelay); if (target.HasBuffOfType(BuffType.Snare) || target.HasBuffOfType(BuffType.Stun)) { Core.DelayAction(delegate { if (ComboMenu.GetCheckBoxValue("eUse") && E.IsReady() && etarget.IsValidTarget(E.Range) && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(etarget); } }, Edelay); if (_Player.HasBuff("LuxEEnd")) { Core.DelayAction(delegate { E.Cast(); }, Edelay); } if (ComboMenu.GetCheckBoxValue("rUse") && R.IsReady() && rtarget.IsValidTarget(R.Range)) { foreach (var ultenemies in enemies) { var useR = ComboMenu["r.ult" + ultenemies.ChampionName].Cast <CheckBox>().CurrentValue; var predictedHealth = Prediction.Health.GetPrediction(target, R.CastDelay + Game.Ping); var passiveDamage = target.HasPassive() ? target.GetPassiveDamage() : 0f; var rDamage = target.GetDamage(SpellSlot.R) + passiveDamage; { if ((useR) && (predictedHealth <= rDamage)) { R.Cast(ultenemies); } else if (R.IsReady()) { var totalDamage = target.GetDamage(SpellSlot.E) + target.GetDamage(SpellSlot.R) + passiveDamage; if (predictedHealth <= totalDamage) { R.Cast(ultenemies); } } } } } if (ComboMenu.GetCheckBoxValue("wUse") && W.IsReady() && Player.Instance.HealthPercent <= ComboMenu.GetSliderValue("hpW")) { W.Cast(wtarget.Position); } } // COMBO 1 END } // COMBO 2 / 3 if (ComboMenu["Comba"].Cast <ComboBox>().CurrentValue == 1) { Core.DelayAction(delegate { if (ComboMenu.GetCheckBoxValue("qUse") && Q.IsReady() && qtarget.IsValidTarget(Q.Range) && Q.GetPrediction(qtarget).HitChance >= Hitch.hitchance(Q, FirstMenu)) { Q.Cast(predq.CastPosition); } }, Qdelay); Core.DelayAction(delegate { if (ComboMenu.GetCheckBoxValue("eUse") && E.IsReady() && etarget.IsValidTarget(E.Range) && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(etarget); } }, Edelay); if (Player.HasBuff("LuxEEnd")) { Core.DelayAction(delegate { E.Cast(); }, Edelay); } if (ComboMenu.GetCheckBoxValue("rUse") && R.IsReady() && rtarget.IsValidTarget(R.Range)) { foreach (var ultenemies in enemies) { var useR = ComboMenu["r.ult" + ultenemies.ChampionName].Cast <CheckBox>().CurrentValue; var predictedHealth = Prediction.Health.GetPrediction(target, R.CastDelay + Game.Ping); var passiveDamage = target.HasPassive() ? target.GetPassiveDamage() : 0f; var rDamage = target.GetDamage(SpellSlot.R) + passiveDamage; { if ((useR) && (predictedHealth <= rDamage)) { R.Cast(ultenemies); } else if (R.IsReady()) { var totalDamage = target.GetDamage(SpellSlot.E) + target.GetDamage(SpellSlot.R) + passiveDamage; if (predictedHealth <= totalDamage) { R.Cast(ultenemies); } } } } } if (ComboMenu.GetCheckBoxValue("wUse") && W.IsReady() && Player.Instance.HealthPercent <= ComboMenu.GetSliderValue("hpW")) { W.Cast(wtarget.Position); } } // COMBO 2 / 3 END }
public static void Execute() { var qtarget = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(x => !x.IsDead && Q.IsInRange(x)); var wtarget = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(x => !x.IsDead && W.IsInRange(x)); var etarget = EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(x => !x.IsDead && E.IsInRange(x)); if (_player.Mana <= 1 - 4) { if (LaneClearMenu.GetCheckBoxValue("qUse") && Q.IsReady()) { Program.Items(); Q.Cast(); Orbwalker.ForcedTarget = qtarget; } if (LaneClearMenu.GetCheckBoxValue("wUse") && W.IsReady()) { W.Cast(); } if (LaneClearMenu.GetCheckBoxValue("eUse") && E.IsReady() && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(etarget); } } if (_player.Mana <= 5 && LaneClearMenu.GetCheckBoxValue("wUse") && W.IsReady() && LaneClearMenu.GetCheckBoxValue("WClearHeal")) { W.Cast(); } }
public static void Execute() { ////////////////////////////////////////////////////////////////////////////////////////////////////////// var target = TargetSelector.GetTarget(1000, DamageType.Magical, Player.Instance.Position); var qtarget = TargetSelector.GetTarget(Q.Range, DamageType.Physical); var wtarget = TargetSelector.GetTarget(W.Range, DamageType.Physical); var etarget = TargetSelector.GetTarget(E.Range, DamageType.Physical); var rtarget = TargetSelector.GetTarget(R.Range, DamageType.Physical); var targetW = TargetSelector.GetTarget(Player.Instance.BoundingRadius + 175, DamageType.Physical); ////////////////////////////////////////////////////////////////////////////////////////////////////////// var quse = ComboMenu.GetCheckBoxValue("qUse"); var wuse = ComboMenu.GetCheckBoxValue("wUse"); var euse = ComboMenu.GetCheckBoxValue("eUse"); var ruse = ComboMenu.GetCheckBoxValue("rUse"); ////////////////////////////////////////////////////////////////////////////////////////////////////////// if (ComboMenu.GetCheckBoxValue("cOne")) { if (target.IsValidTarget(1000) && quse && target.IsEnemy && Q.GetPrediction(target).HitChance >= Hitch.hitchance(Q, FirstMenu)) { Q.Cast(target.Position); } if (R.IsLearned && R.IsReady() && ruse && rtarget.IsStunned || rtarget.IsRooted || rtarget.IsTaunted || rtarget.IsCharmed || rtarget.Spellbook.IsChanneling || rtarget.HasBuffOfType(BuffType.Charm) || rtarget.HasBuffOfType(BuffType.Knockback) || rtarget.HasBuffOfType(BuffType.Knockup) || rtarget.HasBuffOfType(BuffType.Snare) || rtarget.HasBuffOfType(BuffType.Stun) || rtarget.HasBuffOfType(BuffType.Suppression) || // Credits Kappa the Kappa Def. not Kappa ^) rtarget.HasBuffOfType(BuffType.Taunt)) { R.Cast(); } if (W.IsLearned && W.IsReady() && wtarget.IsValidTarget(W.Range * 2) && wuse) { Program.WEnable(); } if (etarget.IsValidTarget(E.Range) && euse && E.IsReady()) { E.Cast(); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////// if (ComboMenu.GetCheckBoxValue("cTwo")) { if (target.IsValidTarget(1000) && quse && target.IsEnemy && Q.GetPrediction(target).HitChance >= Hitch.hitchance(Q, FirstMenu)) { Q.Cast(target.Position); } if (R.IsLearned && R.IsReady() && ruse) { if (Player.Instance.CountEnemiesInRange(R.Range) >= ComboMenu.GetSliderValue("enemyr")) { R.Cast(); } } if (W.IsLearned && W.IsReady() && wtarget.IsValidTarget(W.Range * 2) && wuse) { Program.WEnable(); } if (etarget.IsValidTarget(E.Range) && euse && E.IsReady()) { E.Cast(); } } ////////////////////////////////////////////////////////////////////////////////////////////////////////// }
public static void Execute() { var target = TargetSelector.GetTarget(1500, DamageType.Magical); var etarget = TargetSelector.GetTarget(E.Range, DamageType.Magical); var enemiese = EntityManager.Heroes.Enemies.OrderByDescending (a => a.HealthPercent).Where(a => !a.IsMe && a.IsValidTarget() && a.Distance(Player) <= E.Range); if (ComboMenu.GetCheckBoxValue("eUse") && etarget.IsValidTarget(SpellsManager.E.Range) && E.IsReady() && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { foreach (var eenemies in enemiese) { var predE = E.GetPrediction(eenemies); { E.Cast(predE.CastPosition); } } } if (ComboMenu.GetCheckBoxValue("qUse") && target.IsValidTarget(SpellsManager.Q.Range) && Q.IsReady()) { Q.Cast(); } if (ComboMenu.GetCheckBoxValue("wUse") && W.IsReady()) { W.Cast(); } if (ComboMenu.GetCheckBoxValue("wrUse") && W.IsReady() && target.IsValidTarget(SpellsManager.W.Range)) { W.Cast(); } var enemies = EntityManager.Heroes.Enemies.OrderByDescending(a => a.HealthPercent).Where(a => !a.IsMe && a.IsValidTarget() && a.Distance(_Player) <= R.Range); if (ComboMenu.GetCheckBoxValue("rUse") && ComboMenu.GetCheckBoxValue("manu.ult")) { return; } else if (ComboMenu.GetCheckBoxValue("rUse") && target.IsValidTarget(SpellsManager.R.Range) && R.IsReady()) { foreach (var ultenemies in enemies) { var useR = ComboMenu["r.ult" + ultenemies.ChampionName].Cast <CheckBox>().CurrentValue; { if (useR) { R.Cast(ultenemies); } } } } if (ComboMenu["gankc"].Cast <KeyBind>().CurrentValue) { if (W.IsReady()) { W.Cast(); } if (ComboMenu.GetCheckBoxValue("eUse") && etarget.IsValidTarget(SpellsManager.E.Range) && E.IsReady() && E.GetPrediction(etarget).HitChance >= HitChance.High) { E.Cast(etarget); } if (ComboMenu.GetCheckBoxValue("rUse") && target.IsValidTarget(SpellsManager.R.Range) && R.IsReady()) { foreach (var ultenemies in enemies) { var useR = ComboMenu["r.ult" + ultenemies.ChampionName].Cast <CheckBox>().CurrentValue; { if (useR) { R.Cast(ultenemies); } } } } if (ComboMenu.GetCheckBoxValue("qUse") && target.IsValidTarget(SpellsManager.Q.Range) && Q.IsReady()) { Q.Cast(); } } }
public static void Execute() { var target = EntityManager.MinionsAndMonsters.GetJungleMonsters().OrderByDescending(a => a.MaxHealth).FirstOrDefault(a => a.IsValidTarget(900)); if (JungleClearMenu.GetCheckBoxValue("qUse") && Q.IsReady()) { Program.Items(); Q.Cast(); Orbwalker.ForcedTarget = target; } if (JungleClearMenu.GetCheckBoxValue("wUse") && W.IsReady()) { W.Cast(); } if (JungleClearMenu.GetCheckBoxValue("eUse") && E.IsReady() && E.GetPrediction(target).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(target); } var save = JungleClearMenu.GetCheckBoxValue("JungleSave"); if (_player.Mana != 5 || save) { return; } if (target.IsValidTarget(Q.Range) && Q.IsReady() && FirstMenu.GetComboBoxValue("JunglePrio") == 0 && JungleClearMenu.GetCheckBoxValue("qUse")) { Q.Cast(); } if (target.IsValidTarget(W.Range) && W.IsReady() && FirstMenu.GetComboBoxValue("JunglePrio") == 1 && JungleClearMenu.GetCheckBoxValue("wUse") && !_player.HasBuff("rengarpassivebuff")) { W.Cast(); } Program.Items(); if (target.IsValidTarget(E.Range) && E.IsReady() && FirstMenu.GetComboBoxValue("JunglePrio") == 2 && JungleClearMenu.GetCheckBoxValue("eUse")) { E.Cast(target.ServerPosition); } }
public static void Execute() { var target = TargetSelector.GetTarget(1700, DamageType.Magical); if (target == null || target.IsInvulnerable || target.MagicImmune) { return; } Core.DelayAction(delegate { if (target.IsValidTarget(E.Range) && E.IsReady() && ComboMenu.GetCheckBoxValue("eUse") && (Hitch.ShouldOverload(SpellSlot.E) || Player.Instance.Mana < 80)) { E.Cast(target); } }, Edelay); if (Player.Instance.Spellbook.GetSpell(SpellSlot.E).ToggleState == 1) { E.Cast(target.Position); } if (target.IsValidTarget(Q.Range) && Q.IsReady() && ComboMenu.GetCheckBoxValue("qUse") && Player.Instance.IsFacing(target) && (Hitch.ShouldOverload(SpellSlot.Q) || Player.Instance.Mana < 80)) { Q.Cast(); } if (W.IsReady() && ComboMenu.GetCheckBoxValue("wUse")) { W.Cast(); } var targetR = TargetSelector.GetTarget(R.Range, DamageType.Magical); if (targetR == null || targetR.IsZombie || targetR.HasUndyingBuff()) { return; } if (ComboMenu.GetCheckBoxValue("my") && R.IsReady()) { if (targetR.IsMoving) { if (targetR.IsValidTarget(R.Range + 1000)) { R.Cast(target.Position - target.MoveSpeed); } } else { R.Cast(target.Position + 550); } } if (R.IsReady() && targetR.IsValidTarget(R.Range) && ComboMenu.GetCheckBoxValue("mario") && !targetR.IsInRange(Player.Instance, E.Range) && !targetR.IsFacing(Player.Instance)) { if (KillStealMenu.GetCheckBoxValue("rUse") && Prediction.Health.GetPrediction(targetR, R.CastDelay) <= SpellDamage.GetRealDamage(SpellSlot.R, targetR)) { Hitch.CastR(targetR, MiscMenu.GetSliderValue("minR")); } else { Hitch.CastR(targetR, MiscMenu.GetSliderValue("minR")); } } }
public static void Execute() { var t = TargetSelector.GetTarget(Q2.Range, DamageType.Physical); var reksaifury = Equals(Program._player.Mana, Program._player.MaxMana); if (Program.burrowed) { var targetW = TargetSelector.GetTarget(Player.Instance.BoundingRadius + 175, DamageType.Physical); var targetQ2 = TargetSelector.GetTarget(850, DamageType.Magical); var targetE = TargetSelector.GetTarget(550, DamageType.Physical); var targetE2 = TargetSelector.GetTarget(E2.Range, DamageType.Physical); var predE2 = E2.GetPrediction(targetE2); var predq2 = Q2.GetPrediction(targetQ2).HitChance >= Hitch.hitchance(Q2, FirstMenu); //if (Program.getCheckBoxItem(ComboMenu, "UseQBCombo")) //{ // var tbq = TargetSelector.GetTarget(Q2.Range, DamageType.Magical); // var predqq = Q2.GetPrediction(tbq).HitChance >= Hitch.hitchance(Q2, FirstMenu); // if (Q2.IsReady() && predqq && t.IsValidTarget(Q2.Range)) Q2.Cast(tbq); //} if (ComboMenu.GetCheckBoxValue("UseQBCombo") && Q2.IsReady() && predq2) { var predQ2 = SpellsManager.Q2.GetPrediction(targetQ2); Q2.Cast(predQ2.CastPosition); } if (ComboMenu.GetCheckBoxValue("UseWCombo") && W.IsReady()) { if (targetW != null && targetW.IsValidTarget()) { W.Cast(); return; } } //var predq = Q2.GetPrediction(targetQ2).HitChance >= Hitch.hitchance(Q2, FirstMenu); //if (ComboMenu.GetCheckBoxValue("UseQBCombo") && Q2.IsReady() && predq) // { // if (targetQ2 != null && targetQ2.IsValidTarget()) // { // var predictionQ2 = Q2.GetPrediction(targetQ2); // if (predictionQ2.HitChance >= HitChance.Medium) // { // Q2.Cast(predictionQ2.CastPosition); // return; // } // } // } // if (Program.getCheckBoxItem(ComboMenu, "UseEBCombo")) //{ // var te = TargetSelector.GetTarget(E2.Range + W.Range, DamageType.Physical); // if (E2.IsReady() && te.IsValidTarget(E2.Range + W.Range) && Program._player.Distance(te) > Q.Range) // { // var predE22 = SpellsManager.E2.GetPrediction(te); // E2.Cast(predE22.CastPosition); // } // } } if (!Program.burrowed) { var targetE = TargetSelector.GetTarget(E.Range, DamageType.Physical); var lastTarget = Orbwalker.LastTarget; var target = TargetSelector.GetTarget(300, DamageType.Physical); if (ComboMenu.GetCheckBoxValue("UseQCombo") && Program._player.IsInAutoAttackRange(target)) { Q.Cast(); } if (ComboMenu.GetCheckBoxValue("UseECombo") && E.IsReady()) { if (targetE != null && targetE.IsValidTarget()) { E.Cast(targetE); return; } } if (ComboMenu.GetCheckBoxValue("UseWCombo") && W.IsReady()) { if (Player.Instance.CountEnemiesInRange(400) == 0) { W.Cast(); return; } } if (ComboMenu.GetCheckBoxValue("UseEBCombo")) { var te = TargetSelector.GetTarget(E2.Range + 150, DamageType.Physical); if (E2.IsReady() && te.IsValidTarget(E2.Range + 150)) { var predE22 = SpellsManager.E2.GetPrediction(te); E2.Cast(predE22.CastPosition); } } if (ComboMenu.GetCheckBoxValue("UseWCombo") && W.IsReady()) { if (lastTarget.IsValidTarget(Player.Instance.BoundingRadius + 250) && !target.HasBuff("reksaiknockupimmune")) { W.Cast(); return; } } } }
public static void Execute() { var qtarget = TargetSelector.GetTarget(Q.Range, DamageType.Magical); var wtarget = TargetSelector.GetTarget(W.Range, DamageType.Magical); var etarget = TargetSelector.GetTarget(E.Range, DamageType.Magical); var rtarget = TargetSelector.GetTarget(R.Range, DamageType.Magical); var enemiese = EntityManager.Heroes.Enemies.OrderByDescending (a => a.HealthPercent).Where(a => !a.IsMe && a.IsValidTarget() && a.Distance(Player) <= R.Range); if (qtarget.IsValidTarget()) { if (qtarget != null) { if (ComboMenu.GetCheckBoxValue("qUse") && qtarget.IsValidTarget(SpellsManager.Q.Range) && Q.IsReady() && Q.GetPrediction(qtarget).HitChance >= Hitch.hitchance(Q, ComboMenu) && Q.Name == "VelkozQ") { Q.Cast(qtarget); } } } if (ComboMenu.GetCheckBoxValue("eUse") && E.IsReady() && etarget.IsValidTarget(SpellsManager.E.Range) && E.GetPrediction(qtarget).HitChance >= HitChance.High && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, ComboMenu)) { E.Cast(etarget); } if (ComboMenu.GetCheckBoxValue("wUse") && W.IsReady() && wtarget.IsValidTarget(SpellsManager.W.Range) && W.GetPrediction(wtarget).HitChance >= Hitch.hitchance(W, ComboMenu) && !Program.Champion.HasBuff("VelkozR")) { W.Cast(wtarget); } if (ComboMenu.GetCheckBoxValue("rUse") && R.IsReady()) { foreach (var ultenemies in enemiese) { var useR = ComboMenu["r.ult" + ultenemies.ChampionName].Cast <CheckBox>().CurrentValue; { if (useR) { R.Cast(ultenemies.Position); Program.UltFollowMode(); } } } } }
public static void Execute() { var Target = TargetSelector.GetTarget(E.Range, DamageType.Physical); var ttarget = TargetSelector.GetTarget(Q.Range, DamageType.Physical); if (Target == null || Target.IsInvulnerable || Target.MagicImmune) { return; } var useE = Eclipse.Menus.HarassMenu.GetCheckBoxValue("eUse"); if (Q.IsReady() && Eclipse.Menus.HarassMenu.GetCheckBoxValue("qUse") && ttarget.IsValidTarget(Q.Range -20) && Q.GetPrediction(ttarget).HitChance >= Hitch.hitchance(Q, FirstMenu)) { Q.Cast(ttarget.Position); } if (useE && E.IsReady() && Target.IsValidTarget(E.Range - 20) && E.GetPrediction(Target).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(Target.Position); } }
public static void Execute() { /////////////////////////////////////////////////////////////////////// var Target = TargetSelector.GetTarget(Q.Range, DamageType.Physical); var useW = ComboMenu.GetCheckBoxValue("wUse"); var useE = ComboMenu.GetCheckBoxValue("eUse"); var useR = ComboMenu.GetCheckBoxValue("rUse"); var ultEnemies = ComboMenu.GetSliderValue("combo.REnemies"); if (Target == null || Target.IsInvulnerable || Target.MagicImmune) { return; } /////////////////////////////////////////////////////////////////////// if (useE && E.IsReady() && E.GetPrediction(Target).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(Target.ServerPosition); } if (Q.IsReady() && Q.GetPrediction(Target).HitChance >= Hitch.hitchance(Q, FirstMenu)) { if (Target.IsUnderHisturret()) { return; } if (ComboMenu.GetSliderValue("Q1") > 0) { switch (ComboMenu.GetSliderValue("Q1")) { case 1: Q.Cast(Target.ServerPosition); break; case 2: foreach (var h in EntityManager.Heroes.Enemies.Where(h => h.IsValidTarget())) { Q.Cast(h.ServerPosition); } break; } } } if (W.IsReady() && useW) { if (_player.HealthPercent < ComboMenu.GetSliderValue("combo.minw")) { if (_player.Spellbook.GetSpell(SpellSlot.W).ToggleState == 2) { W.Cast(); } } if (_player.HealthPercent > ComboMenu.GetSliderValue("combo.maxw")) { if (_player.Spellbook.GetSpell(SpellSlot.W).ToggleState == 1) { W.Cast(); } } } if (ComboMenu["RS"].Cast <ComboBox>().CurrentValue == 0 && useR && R.IsReady() && _player.ServerPosition.CountEnemiesInRange(500f) <= ultEnemies) { R.Cast(); } else if (ComboMenu["RS"].Cast <ComboBox>().CurrentValue == 1 && useR && R.IsReady() && Player.Instance.IsFacing(Target) && _player.ServerPosition.CountEnemiesInRange(500f) <= ultEnemies) { R.Cast(); } else if (ComboMenu["RS"].Cast <ComboBox>().CurrentValue == 2 && useR && R.IsReady() && Program._player.HealthPercent <= 25 && _player.ServerPosition.CountEnemiesInRange(500f) <= ultEnemies) { R.Cast(); } }
public static void Execute() { var ttarget = TargetSelector.GetTarget(1000, DamageType.Physical); if (E.IsReady() && Player.Instance.Mana == 5 && MiscMenu.GetCheckBoxValue("eflee") && E.GetPrediction(ttarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { var target = TargetSelector.GetTarget(1000, DamageType.Physical); E.Cast(target); } else if (E.IsReady() && MiscMenu.GetCheckBoxValue("eflee")) { var target = TargetSelector.GetTarget(1000, DamageType.Physical); E.Cast(target); } }
public static void Execute() { var enemiese = EntityManager.Heroes.Enemies.OrderByDescending (a => a.HealthPercent).Where(a => !a.IsMe && a.IsValidTarget() && a.Distance(Player) <= E.Range); var target = TargetSelector.GetTarget(1500, DamageType.Magical); var etarget = TargetSelector.GetTarget(E.Range, DamageType.Magical); if (HarassMenu.GetCheckBoxValue("eUse") && etarget.IsValidTarget(SpellsManager.E.Range) && E.IsReady() && E.GetPrediction(etarget).HitChance >= Hitch.hitchance(E, FirstMenu)) { foreach (var eenemies in enemiese) { var predE = E.GetPrediction(eenemies); { E.Cast(predE.CastPosition); } } } }
/// <summary> /// 接收 /// </summary> /// <param name="data"></param> /// <returns></returns> public ClientReport clientReportSerialize(byte[] data) { HandelControls theHandelControls = HandelControls.createHandelControls(); ClientReport theClientReport = new ClientReport(); try { theClientReport.HEAD_FIELD = data[0]; theClientReport.REPORT_LENGTH = data.Skip(1).Take(4).ToArray(); byte[] dataLength = data.Skip(1).Take(4).ToArray(); int dataLengthInt = returnByteLengthRight(dataLength); data = data.Skip(0).Take(dataLengthInt).ToArray(); theClientReport.CONTROL_FIELD = data[5]; // theClientReport.REPORT_BODY = data.Skip(6).Take(dataLengthInt-8); theClientReport.END_FIELD = data[data.Length - 1]; data = data.Skip(6).Take(dataLengthInt - 8).ToArray(); int fileCount = 0; //默认文件长度; int nowIndex = 0; //当前位置; int dataCount = 0; TheCatalog theCatalog = new TheCatalog(); //文件目录 CatalogFiles theCatalogFiles = new CatalogFiles(); //文件 TheRemoteDataArray theRemoteDataArray = new TheRemoteDataArray(); //遥信 ResponseValueData theResponseValue = new ResponseValueData(); //设定值 switch (theClientReport.CONTROL_FIELD) { case 0x02: returnLoginInfo theReturnLoginInfo = new returnLoginInfo(); byte[] theByte = data; theReturnLoginInfo.isOk = theByte[0]; theClientReport.REPORT_BODY = theReturnLoginInfo; break; case 0x03: byte[] checkData = data; DeviceData theTreeArrayData = new DeviceData(); theTreeArrayData.theDeviceData = new List <DeviceDataInfo>(); int count = checkData[0]; checkData = checkData.Skip(1).ToArray(); while (count > 0) { DeviceDataInfo theDeviceDataInfo = new DeviceDataInfo(); int ct = checkData.Skip(nowIndex).Take(1).ToArray()[0];//设备名称长度 theDeviceDataInfo.DeviceName = checkData.Skip(nowIndex + 1).Take(ct).ToArray <byte>(); theDeviceDataInfo.DeviceAddress = checkData.Skip(nowIndex + ct + 1).Take(2).ToArray <byte>(); theDeviceDataInfo.DeviceStatue = checkData.Skip(nowIndex + ct + 3).Take(1).ToArray()[0]; theDeviceDataInfo.DeviceLastOnline = checkData.Skip(nowIndex + ct + 4).Take(7).ToArray(); nowIndex += ct + 11; theTreeArrayData.theDeviceData.Add(theDeviceDataInfo); count--; } theClientReport.REPORT_BODY = theTreeArrayData; break; case 0x05: byte[] checkCatalogData = data; theCatalog.DEVICE_ADDRESS = checkCatalogData.Take(2).ToArray <byte>(); //设备地址 theCatalog.FILES_COUNT = checkCatalogData[2]; //文件数量 fileCount = theCatalog.FILES_COUNT; theCatalog.THE_CATALOG_FILES = new List <CatalogFiles>(); byte[] nowCatalogData = checkCatalogData.Skip(3).Take(checkCatalogData.Length - 2).ToArray <byte>(); while (fileCount > 0) { CatalogFiles catalogFiles = new CatalogFiles(); catalogFiles.FILE_LENGTH = nowCatalogData[nowIndex]; catalogFiles.FILE_NAME = nowCatalogData.Skip(nowIndex + 1).Take(catalogFiles.FILE_LENGTH).ToArray <byte>(); theCatalog.THE_CATALOG_FILES.Add(catalogFiles); nowIndex += catalogFiles.FILE_LENGTH + 1; fileCount--; } theClientReport.REPORT_BODY = theCatalog; break; case 0x07: byte[] updateCatalogData = data; theCatalogFiles.DeviceAddress = updateCatalogData.Take(2).ToArray <byte>(); //文件地址 theCatalogFiles.FILE_LENGTH = updateCatalogData[2]; //文件名长度 theCatalogFiles.FILE_NAME = updateCatalogData.Skip(3).Take(theCatalogFiles.FILE_LENGTH).ToArray <byte>(); //文件名 int fileContent = theCatalogFiles.FILE_NAME.Length + 3; theCatalogFiles.FILE_CONTENT = updateCatalogData.Skip(fileContent).ToArray <byte>(); //文件长度 theClientReport.REPORT_BODY = theCatalogFiles; break; case 0x10: //遥信返回(不带时标) byte[] notHaveTimeMark = data; theRemoteDataArray.DEVICE_ADDRESS = notHaveTimeMark.Take(2).ToArray <byte>(); theRemoteDataArray.THE_COUNT = notHaveTimeMark[2]; theRemoteDataArray.THE_TYPE_NAME = "遥信"; fileCount = theRemoteDataArray.THE_COUNT; theRemoteDataArray.THE_REMOTE_DATA = new List <TheRemoteData>(); notHaveTimeMark = notHaveTimeMark.Skip(3).ToArray <byte>(); while (fileCount > 0) { TheRemoteData theRemoteData = new TheRemoteData(); theRemoteData.RemoteAddress = notHaveTimeMark.Skip(nowIndex).Take(2).ToArray <byte>(); theRemoteData.RemoteValue = notHaveTimeMark.Skip(nowIndex + 2).Take(1).ToArray <byte>(); nowIndex = nowIndex + 3; fileCount--; theRemoteDataArray.THE_REMOTE_DATA.Add(theRemoteData); } theClientReport.REPORT_BODY = theRemoteDataArray; theThreadMethod = new Thread(forEachList); theThreadMethod.IsBackground = true; theThreadMethod.Start(theRemoteDataArray); break; case 0x11: //遥信返回(带时标) byte[] haveTimeMark = data; theRemoteDataArray.DEVICE_ADDRESS = haveTimeMark.Take(2).ToArray <byte>(); theRemoteDataArray.THE_COUNT = haveTimeMark[2]; theRemoteDataArray.THE_COUNT = haveTimeMark[2]; theRemoteDataArray.THE_TYPE_NAME = "遥信"; fileCount = theRemoteDataArray.THE_COUNT; theRemoteDataArray.THE_REMOTE_DATA = new List <TheRemoteData>(); haveTimeMark = haveTimeMark.Skip(3).ToArray <byte>(); while (fileCount > 0) { TheRemoteData theRemoteData = new TheRemoteData(); theRemoteData.RemoteAddress = haveTimeMark.Skip(nowIndex).Take(2).ToArray <byte>(); theRemoteData.RemoteValue = haveTimeMark.Skip(nowIndex + 2).Take(1).ToArray <byte>(); theRemoteData.LastestModify = haveTimeMark.Skip(nowIndex + 3).Take(7).ToArray <byte>(); nowIndex = nowIndex + 10; fileCount--; theRemoteDataArray.THE_REMOTE_DATA.Add(theRemoteData); } theClientReport.REPORT_BODY = theRemoteDataArray; theThreadMethod = new Thread(forEachList); theThreadMethod.IsBackground = true; theThreadMethod.Start(theRemoteDataArray); break; case 0x12: //遥测 byte[] telemeteringTimeMark = data; theRemoteDataArray.DEVICE_ADDRESS = telemeteringTimeMark.Take(2).ToArray <byte>(); theRemoteDataArray.THE_COUNT = telemeteringTimeMark[2]; theRemoteDataArray.THE_TYPE_NAME = "遥测"; fileCount = theRemoteDataArray.THE_COUNT; theRemoteDataArray.THE_REMOTE_DATA = new List <TheRemoteData>(); telemeteringTimeMark = telemeteringTimeMark.Skip(3).ToArray <byte>(); while (fileCount > 0) { TheRemoteData theRemoteData = new TheRemoteData(); theRemoteData.LastestModify = new byte[] { 0x00 }; theRemoteData.RemoteAddress = telemeteringTimeMark.Skip(nowIndex).Take(2).ToArray <byte>(); theRemoteData.RemoteValue = telemeteringTimeMark.Skip(nowIndex + 2).Take(2).ToArray <byte>(); theRemoteData.quility = telemeteringTimeMark.Skip(nowIndex + 4).Take(1).ToArray <byte>()[0]; nowIndex = nowIndex + 5; fileCount--; theRemoteDataArray.THE_REMOTE_DATA.Add(theRemoteData); } theClientReport.REPORT_BODY = theRemoteDataArray; theThreadMethod = new Thread(forEachList); theThreadMethod.IsBackground = true; theThreadMethod.Start(theRemoteDataArray); break; case 0x14: byte[] responseValueTimeMark = data; theResponseValue.DEVICE_ADDRESS = responseValueTimeMark.Take(2).ToArray <byte>(); theResponseValue.VALUE_TYPE = responseValueTimeMark[2]; theResponseValue.VALUE_COUNT = responseValueTimeMark[3]; fileCount = theResponseValue.VALUE_COUNT; theResponseValue.theResponseValueArray = new List <ResponseValue>(); responseValueTimeMark = responseValueTimeMark.Skip(4).ToArray <byte>(); while (fileCount > 0) { ResponseValue rsponseValue = new ResponseValue(); rsponseValue.VALUE_ADDRESS = responseValueTimeMark.Skip(nowIndex).Take(2).ToArray <byte>(); int length = responseValueTimeMark.Skip(nowIndex + 2).Take(1).ToArray <byte>()[0]; rsponseValue.VALUE = responseValueTimeMark.Skip(nowIndex + 3).Take(length).ToArray <byte>(); nowIndex = nowIndex + 3 + length; theResponseValue.theResponseValueArray.Add(rsponseValue); fileCount--; } theClientReport.REPORT_BODY = theResponseValue; break; case 0x0a: byte[] contentText = data; ReportContentText theReportContent = new ReportContentText(); theReportContent.ReportType = contentText[0]; theReportContent.ReportDateTime = contentText.Skip(1).Take(7).ToArray <byte>(); theReportContent.ReportContent = contentText.Skip(8).ToArray <byte>(); theClientReport.REPORT_BODY = theReportContent; break; case 0x21: byte[] writeBytes = data; WriteFile theWriteFile = new WriteFile(); theWriteFile.DEVICE_ADDRESS = writeBytes.Take(2).ToArray(); theWriteFile.FILE_LENGTH = writeBytes.Skip(2).Take(1).ToArray()[0]; theWriteFile.FILE_NAME = writeBytes.Skip(3).Take(theWriteFile.FILE_LENGTH).ToArray(); theWriteFile.FILE_COUNT = writeBytes.Skip(3 + theWriteFile.FILE_LENGTH).ToArray(); break; case 0x23: //接收变电站 List <ConvertingStation> theConvertingStationArray = new List <ConvertingStation>(); dataCount = returnByteLengthRight(data.Take(4).ToArray()); data = data.Skip(4).ToArray(); while (dataCount > 0) { ConvertingStation theConvertingStation = new ConvertingStation(); int convertingNameLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theConvertingStation.stationName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingNameLength).ToArray(), "utf-8"); nowIndex += convertingNameLength; int remarksLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theConvertingStation.stationRemarks = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(remarksLength).ToArray(), "utf-8"); nowIndex += remarksLength; theConvertingStation.stationID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; dataCount--; theConvertingStationArray.Add(theConvertingStation); } theClientReport.REPORT_BODY = theConvertingStationArray; break; case 0x24: //接收母线 List <Generatrix> theGeneratrixArray = new List <Generatrix>(); dataCount = returnByteLengthRight(data.Take(4).ToArray()); data = data.Skip(4).ToArray(); while (dataCount > 0) { Generatrix theGeneratrix = new Generatrix(); int convertingNameLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theGeneratrix.GeneratrixName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingNameLength).ToArray(), "utf-8"); nowIndex += convertingNameLength; int remarksLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theGeneratrix.GeneratrixNumber = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(remarksLength).ToArray(), "utf-8"); nowIndex += remarksLength; theGeneratrix.GeneratrixID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; int convertingLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theGeneratrix.GeneratrixToName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingLength).ToArray(), "utf-8"); nowIndex += convertingLength; theGeneratrix.GeneratrixToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; dataCount--; theGeneratrixArray.Add(theGeneratrix); } theClientReport.REPORT_BODY = theGeneratrixArray; break; case 0x25: //接收线路 List <Circuit> theCircuitArray = new List <Circuit>(); dataCount = returnByteLengthRight(data.Take(4).ToArray()); data = data.Skip(4).ToArray(); while (dataCount > 0) { Circuit theCircuit = new Circuit(); int convertingNameLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theCircuit.CircuitName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingNameLength).ToArray(), "utf-8"); nowIndex += convertingNameLength; int remarksLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theCircuit.CircuitNumber = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(remarksLength).ToArray(), "utf-8"); nowIndex += remarksLength; theCircuit.CircuitID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; int convertingLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theCircuit.CircuitToName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingLength).ToArray(), "utf-8"); nowIndex += convertingLength; theCircuit.CircuitToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; dataCount--; theCircuitArray.Add(theCircuit); } theClientReport.REPORT_BODY = theCircuitArray; break; case 0x26: //接收检测点 List <Detection> theDetectionArray = new List <Detection>(); dataCount = returnByteLengthRight(data.Take(4).ToArray()); data = data.Skip(4).ToArray(); while (dataCount > 0) { Detection theDetection = new Detection(); int convertingNameLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.DetectionName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingNameLength).ToArray(), "utf-8"); nowIndex += convertingNameLength; int theNumber = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.DetectionNumber = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(theNumber).ToArray(), "utf-8"); nowIndex += theNumber; theDetection.DetectionID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; int detectionToSecondName = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.DetectionToSecondName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(detectionToSecondName).ToArray(), "utf-8"); nowIndex += detectionToSecondName; theDetection.DetectionToSecondID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; theDetection.RemoteA = ByteWithString.byteToHexStr(data.Skip(nowIndex).Take(2).ToArray()); nowIndex += 2; theDetection.RemoteB = ByteWithString.byteToHexStr(data.Skip(nowIndex).Take(2).ToArray()); nowIndex += 2; theDetection.RemoteC = ByteWithString.byteToHexStr(data.Skip(nowIndex).Take(2).ToArray()); nowIndex += 2; int circuitLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.DetectionToName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(circuitLength).ToArray(), "utf-8"); nowIndex += circuitLength; theDetection.DetectionToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; dataCount--; theDetectionArray.Add(theDetection); } theClientReport.REPORT_BODY = theDetectionArray; break; case 0x33: List <DeviceDataSetting> theDeviceDataArray = new List <DeviceDataSetting>(); dataCount = returnByteLengthRight(data.Take(4).ToArray()); data = data.Skip(4).ToArray(); while (dataCount > 0) { DeviceDataSetting theDetection = new DeviceDataSetting(); int convertingNameLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.DeviceDataName = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(convertingNameLength).ToArray(), "utf-8"); //ok nowIndex += convertingNameLength; theDetection.DeviceDataID = ByteWithString.byteToHexStr(data.Skip(nowIndex).Take(2).ToArray()).ToString(); nowIndex += 2; theDetection.LastDateTime = ByteWithString.ConvertCP56TIME2aToDateTime(data.Skip(nowIndex).Take(7).ToArray()).ToString("yyyy-MM-dd HH:mm:ss"); nowIndex += 7; int ALength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.TheRemoteA = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(ALength).ToArray(), "utf-8"); nowIndex += ALength; theDetection.RemoteAToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; int BLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.TheRemoteB = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(BLength).ToArray(), "utf-8"); nowIndex += BLength; theDetection.RemoteBToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; int CLength = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()); nowIndex += 4; theDetection.TheRemoteC = ByteWithString.bytetoCodeString(data.Skip(nowIndex).Take(CLength).ToArray(), "utf-8"); nowIndex += CLength; theDetection.RemoteCToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; theDetection.DeviceDataToID = returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray()).ToString(); nowIndex += 4; dataCount--; theDeviceDataArray.Add(theDetection); } theClientReport.REPORT_BODY = theDeviceDataArray; break; case 0x35: List <int> valueBuilder = new List <int>(); valueBuilder.Add(returnByteLengthRight(data.Skip(0).Take(4).ToArray())); valueBuilder.Add(returnByteLengthRight(data.Skip(4).Take(4).ToArray())); valueBuilder.Add(returnByteLengthRight(data.Skip(8).Take(4).ToArray())); theClientReport.REPORT_BODY = valueBuilder; break; case 0x38: Hitch theHitch = new Hitch(); theHitch.COUNT = dataCount = returnByteLengthRight(data.Take(4).ToArray()); theHitch.NOW_ID = new List <int>(); data = data.Skip(4).ToArray(); while (dataCount > 0) { theHitch.NOW_ID.Add(returnByteLengthRight(data.Skip(nowIndex).Take(4).ToArray())); nowIndex += 4; dataCount--; } theClientReport.REPORT_BODY = theHitch; break; default: break; } theClientReport.VALIDATE_FIELD = data.Skip(data.Length - 2).Take(1).ToArray()[0]; theClientReport.END_FIELD = 0x16; } catch (Exception msg) { Log.LogWrite(msg); } return(theClientReport); }
public static void Execute() { var target = TargetSelector.GetTarget(2000, DamageType.Physical); var rtarget = TargetSelector.GetTarget(R.Range, DamageType.Magical); var useQ = HarassMenu.GetCheckBoxValue("qUse"); var useW = HarassMenu.GetCheckBoxValue("wUse"); var useE = HarassMenu.GetCheckBoxValue("eUse"); var useR = HarassMenu.GetCheckBoxValue("rUse"); var useEE = HarassMenu.GetCheckBoxValue("UseEEC"); var tqq = TargetSelector.GetTarget(Q.Range, DamageType.Physical); var tee = TargetSelector.GetTarget(E.Range, DamageType.Physical); if (useQ && tqq.IsValidTarget(SpellsManager.Q.Range) && Q.IsReady()) { Q.Cast(); } if (useE && tee.IsValidTarget(E.Range) && E.IsReady() && E.GetPrediction(tee).HitChance >= Hitch.hitchance(E, FirstMenu)) { E.Cast(tee); } if (useW && tqq.IsValidTarget(SpellsManager.W.Range) && W.IsReady()) { W.Cast(); } }