private static void Game_OnUpdate(EventArgs args) { if (!loaded) { //Orbwalking.Load(); me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; Game.PrintMessage( "<font face='Tahoma'><font color='#000000'>[--</font> <font color='#33ff66'>Orbwalker</font> by <font color='#999999'>MOON</font><font color='#ff9900'>ES</font> loaded! <font color='#000000'>--]</font></font>", MessageType.LogMessage); } if (me == null || !me.IsValid) { //Orbwalking.Load(); loaded = false; me = ObjectMgr.LocalHero; if (rangeDisplay == null) { return; } rangeDisplay = null; return; } if (Game.IsPaused) { return; } if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } else { if (lastRange != (me.GetAttackRange() + me.HullRadius + 25)) { lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.Dispose(); rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(128); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsVisible || !creepTarget.IsAlive || creepTarget.Health <= 0 || !Orbwalking.AttackOnCooldown(creepTarget))) { creepTarget = TargetSelector.GetLowestHPCreep(me); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(creepTarget); } if (Game.IsKeyDown(Menu.Item("chaseKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(target, attackmodifiers: true); } if (Game.IsKeyDown(Menu.Item("kiteKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusWindupMs: Menu.Item("bonusWindup").GetValue <Slider>().Value); } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { //Orbwalking.Load(); me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; } if (me == null || !me.IsValid) { //Orbwalking.Load(); loaded = false; me = ObjectMgr.LocalHero; if (rangeDisplay == null) { return; } rangeDisplay = null; return; } if (Game.IsPaused) { return; } if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } else { if (lastRange != (me.GetAttackRange() + me.HullRadius + 25)) { lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.Dispose(); rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(128); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } if (Game.IsKeyDown(FarmKey) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsVisible || !creepTarget.IsAlive || creepTarget.Health <= 0 || !Orbwalking.AttackOnCooldown(creepTarget))) { creepTarget = TargetSelector.GetLowestHPCreep(me); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(FarmKey)) { Orbwalking.Orbwalk(creepTarget); } if (Game.IsKeyDown(ChaseKey)) { Orbwalking.Orbwalk(target, attackmodifiers: true); } if (Game.IsKeyDown(KiteKey)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusRange: (float)(UnitDatabase.GetAttackRate(me) * 1000)); } }
/// <summary> /// The game_ on update. /// </summary> /// <param name="args"> /// The args. /// </param> private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; target = null; RangeDisplay.Dispose(); Game.PrintMessage( "<font face='Tahoma'><font color='#000000'>[--</font> <font color='#33ff66'>Orbwalker</font> by <font color='#999999'>MOON</font><font color='#ff9900'>ES</font> loaded! <font color='#000000'>--]</font></font>", MessageType.LogMessage); } if (me == null || !me.IsValid) { loaded = false; me = ObjectMgr.LocalHero; target = null; RangeDisplay.Dispose(); return; } RangeDisplay.Me(); if (Game.IsPaused) { return; } if (RangeDisplay.IsDisposed()) { if (me.IsAlive) { RangeDisplay.Create(); } } else { if (!me.IsAlive) { RangeDisplay.Dispose(); } else if (!RangeDisplay.IsUpdated()) { RangeDisplay.Update(); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); var cd = Orbwalking.AttackOnCooldown(creepTarget); if ((canCancel || !cd) && Utils.SleepCheck("Orbwalk.Attack")) { if (Utils.SleepCheck("Orbwalker.Update.Target")) { if (target != null && !target.IsVisible) { target = me.ClosestToMouseTarget(128); } else if (target == null) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } Utils.Sleep(500, "Orbwalker.Update.Target"); } if (!Game.IsChatOpen && Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsAlive || !creepTarget.IsVisible || Utils.SleepCheck("Orbwalker.Update.Creep"))) { creepTarget = TargetSelector.GetLowestHPCreep(me, 200); Utils.Sleep(500, "Orbwalker.Update.Creep"); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(creepTarget); return; } if (Game.IsKeyDown(Menu.Item("chaseKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(target, attackmodifiers: true); return; } if (Game.IsKeyDown(Menu.Item("kiteKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusWindupMs: Menu.Item("bonusWindup").GetValue <Slider>().Value); } }