Example #1
0
        public ManaChecker(Menu mainMenu)
        {
            var menu = new Menu("Mana Combo Checker", "manaChecker", false, "item_energy_booster", true);
            var heroName = Variables.Hero.Name;

            menu.AddItem(enabled = new MenuItem(heroName + "enabledMC", "Enabled").SetValue(false))
                .SetTooltip("Don't forget to change text position");
            menu.AddItem(enabledAbilities = new MenuItem(heroName + "enabledMCAbilities", "Enabled for"))
                .SetValue(abilityToggler = new AbilityToggler(abilities));
            menu.AddItem(
                manaInfo =
                    new MenuItem("mcManaInfo", "Show mana info").SetValue(true)
                        .SetTooltip("Will show how much mana left/needed after/before casting combo"));
            menu.AddItem(
                ptMana =
                    new MenuItem("mcPTcalculations", "Include PT calculations").SetValue(true)
                        .SetTooltip("Will include in calculations mana gained from Power Treads switching"));
            menu.AddItem(textSize = new MenuItem("mcSize", "Text size").SetValue(new Slider(25, 20, 40)));

            var x = (int)HUDInfo.ScreenSizeX();
            var y = (int)HUDInfo.ScreenSizeY();

            menu.AddItem(xPos = new MenuItem("mcX", "Position X").SetValue(new Slider((int)(x * 0.65), 0, x)));
            menu.AddItem(yPos = new MenuItem("mcY", "Position Y").SetValue(new Slider((int)(y * 0.8), 0, y)));

            mainMenu.AddSubMenu(menu);
        }
Example #2
0
        public PowerTreads(Menu mainMenu)
        {
            var menu = new Menu("Power Treads Switcher", "ptSwitcher", false, "item_power_treads", true);
            var heroName = Variables.Hero.Name;

            menu.AddItem(enabled = new MenuItem(heroName + "enabledPT", "Enabled").SetValue(true));
            menu.AddItem(enabledAbilities = new MenuItem(heroName + "enabledPTAbilities", "Enabled for"))
                .SetValue(abilityToggler = new AbilityToggler(abilities));
            menu.AddItem(
                    switchOnMove =
                        new MenuItem(heroName + "switchPTonMove", "Switch when moving").SetValue(
                            new StringList(Attributes.Keys.ToArray())))
                .SetTooltip("Switch PT to selected attribute when moving");
            menu.AddItem(
                    switchOnAttack =
                        new MenuItem(heroName + "switchPTonAttack", "Swtich when attacking").SetValue(
                            new StringList(Attributes.Keys.ToArray())))
                .SetTooltip("Switch PT to selected attribute when attacking");
            menu.AddItem(switchOnHeal = new MenuItem(heroName + "switchPTHeal", "Swtich when healing").SetValue(true))
                .SetTooltip("Bottle, flask, tango and some hero spells");
            menu.AddItem(
                manaThreshold =
                    new MenuItem("manaPTThreshold", "Mana cost threshold").SetValue(new Slider(15, 0, 50))
                        .SetTooltip("Don't switch PT if spell/Item costs less mana"));
            menu.AddItem(
                autoDisableTime =
                    new MenuItem(heroName + "autoPTdisable", "Auto disable PT switcher after (mins)").SetValue(
                        new Slider(0, 0, 60)));

            mainMenu.AddSubMenu(menu);
        }
Example #3
0
        public SoulRing(Menu mainMenu)
        {
            var menu = new Menu("Auto Soul Ring", "soulringAbuse", false, "item_soul_ring", true);
            var heroName = Variables.Hero.Name;

            menu.AddItem(enabled = new MenuItem(heroName + "enabledSR", "Enabled").SetValue(true));
            menu.AddItem(enabledAbilities = new MenuItem(heroName + "enabledSRAbilities", "Enabled for"))
                .SetValue(abilityToggler = new AbilityToggler(abilities));
            menu.AddItem(
                manaThreshold =
                    new MenuItem(heroName + "soulringMPThreshold", "MP% threshold").SetValue(new Slider(90))
                        .SetTooltip("Don't use soul ring if you have more MP%"));
            menu.AddItem(
                healthThreshold =
                    new MenuItem(heroName + "soulringHPThreshold", "HP% threshold").SetValue(new Slider(30))
                        .SetTooltip("Don't use soul ring if you have less HP%"));

            mainMenu.AddSubMenu(menu);
        }
Example #4
0
        public UsableAbilitiesMenu(Menu rootMenu)
        {
            var menu = new Menu("Abilities", "usableAbilities");
            menu.AddItem(
                usableBlinkAbilities =
                    new MenuItem("usableBlinkAbilities", "Blink:").SetValue(
                        blinkAbilityToggler = new AbilityToggler(blinkAbilities)));
            menu.AddItem(
                usableCounterAbilities =
                    new MenuItem("usableCounterAbilities", "Counter:").SetValue(
                        counterAbilityToggler = new AbilityToggler(counterAbilities)));
            menu.AddItem(
                usableDiasbleAbilities =
                    new MenuItem("usableDiasbleAbilities", "Disable:").SetValue(
                        disableAbilityToggler = new AbilityToggler(disableAbilities)));

            specials = new Menu("Specials", "specials");
            menu.AddSubMenu(specials);

            rootMenu.AddSubMenu(menu);
        }
Example #5
0
        public static void Game_OnUpdate(EventArgs args)
        {
            if (!isloaded)
            {
                me = ObjectManager.LocalHero;
                if (!Game.IsInGame || me == null)
                {
                    return;
                }
                if (me.Team == Team.Dire)
                    foreach (var creepWave in CreepWaves)
                        creepWave.Coords.Reverse();
                isloaded = true;
            }

            if (me == null || !me.IsValid)
            {
                isloaded = false;
                me = ObjectManager.LocalHero;
                return;
            }

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_Meepo || Game.IsPaused || Game.IsChatOpen)
            {
                return;
            }

            var stackKey = Menu.Item("Stack").GetValue<KeyBind>().Active;
            var lanePush = Menu.Item("LanePush").GetValue<KeyBind>().Active;
            var JungleFarm = Menu.Item("JungleFarm").GetValue<KeyBind>().Active;
            _menuValue = Menu.Item("enabledAbilities").GetValue<AbilityToggler>();
            W = me.Spellbook.Spell2;
            var wRadius = W.GetCastRange() - 30;
            var movementspeed = me.MovementSpeed;

            travels = me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_travel_boots"));

            meepos = ObjectMgr.GetEntities<Meepo>().Where(meepo => meepo.Team == me.Team && !meepo.Equals(me)).ToList();

            var seconds = ((int)Game.GameTime) % 60;

            if (JungleCamps.FindAll(x => x.meepos != null).Count != meepos.Count || seconds == 1)
            {
                foreach (var camp in JungleCamps)
                {
                    camp.meepos = null;
                    camp.Stacking = false;
                    camp.Farming = false;
                    camp.State = 0;
                }
            }
            if (seconds == 0)
            {
                foreach (var camp in JungleCamps)
                {
                    camp.meepos = null;
                    camp.Stacking = false;
                    camp.Farming = false;
                    camp.Empty = false;
                    camp.State = 0;
                }
            }

            #region lanepush

            if (lanePush && Utils.SleepCheck("lanePush"))
            {
                try
                {
                    var creeps =
                        ObjectManager.GetEntities<Unit>()
                            .Where(
                                x =>
                                    x.IsAlive && x.IsVisible && x.Team != me.Team
                                    && (x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane
                                    || x.ClassID == ClassID.CDOTA_BaseNPC_Creep
                                    || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral
                                    || x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege
                                     ))
                            .OrderByDescending(x => x.Distance2D(new Vector3(0, 0, 0))).ToList();

                    var creepdel = new List<Unit>();
                    foreach (var creepWave in CreepWaves)
                    {
                        creepdel.AddRange(creepWave.Creeps.Where(creep => creeps.All(x => x.Handle != creep.Handle)));
                        foreach (var creep in creepdel)
                            creepWave.Creeps.Remove(creep);
                    }

                    foreach (var creep in creeps)
                    {
                        float[] distance = { float.MaxValue };
                        var name = "";
                        foreach (var creepWave in CreepWaves)
                        {
                            foreach (var pos in creepWave.Coords.Where(pos => distance[0] > pos.Distance2D(creep)))
                            {
                                name = creepWave.Name;
                                distance[0] = pos.Distance2D(creep);
                            }
                        }
                        if (CreepWaves.Any(x => x.Name == name && !x.Creeps.Contains(creep)))
                            CreepWaves.First(x => x.Name == name && !x.Creeps.Contains(creep)).Creeps.Add(creep);
                    }

                    foreach (var creepWave in CreepWaves)
                    {
                        if (creepWave.Creeps.Count > 0)
                            creepWave.Position = new Vector3(
                                creepWave.Creeps.Average(x => x.Position.X),
                                creepWave.Creeps.Average(x => x.Position.Y),
                                creepWave.Creeps.Average(x => x.Position.Z));
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error LanePush" + e);
                }

                if (meepos.Count > 0)
                {
                    try
                    {
                        foreach (var meepo in meepos)
                        {
                            if (!CreepWaves.Any(x => x.meepo != null && x.meepo.Handle == meepo.Handle) &&
                                CreepWaves.Count(x => x.meepo == null) > 0)
                                CreepWaves.First(x => x.meepo == null).meepo = meepo;
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("Error LanePush 4");
                    }
                    try
                    {
                        foreach (var creepWave in CreepWaves.Where(x => x.meepo != null))
                        {
                            if (GetClosestCreep(creepWave) != null)
                            {
                                if (creepWave.meepo.Distance2D(GetClosestWave(creepWave)) < 300
                                    || creepWave.meepo.Distance2D(creepWave.Position) < 1000)
                                    creepWave.meepo.Attack(GetClosestCreep(creepWave));
                                else
                                    creepWave.meepo.Move(creepWave.Position);
                            }
                            else
                            {
                                if (creepWave.meepo.Distance2D(GetClosestWave(creepWave)) > 100)
                                {
                                    creepWave.meepo.Move(GetClosestWave(creepWave));
                                    creepWave.Position = GetNextWave(creepWave);
                                }
                                else
                                {
                                    creepWave.meepo.Move(GetNextWave(creepWave));
                                    creepWave.Position = GetNextWave(creepWave);
                                }
                            }

                            if (creepWave.meepo.Modifiers.Any(
                                m => m.Name == "modifier_kill" && Math.Abs(m.Duration - m.ElapsedTime - 1) < 0) ||
                                meepos.All(x => x.Handle != creepWave.meepo.Handle))
                                creepWave.meepo = null;
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Error LanePush 5" + e);
                    }
                }
                Utils.Sleep(500, "lanePush");
            }
            #endregion

            #region Stack

            else if (stackKey && meepos.Count > 0 && Utils.SleepCheck("wait"))
            {
                foreach (var meepo in meepos)
                {
                    if (!Check(meepo))
                    {
                        JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, true, false).Id).meepos = meepo;
                        JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, true, false).Id).Stacking = true;
                    }
                    else
                    {
                        var illusionCamps = CheckMeepo(meepo);
                        switch (illusionCamps.State)
                        {
                            case 0:
                                if (meepo.Distance2D(illusionCamps.WaitPosition) < 5)
                                    illusionCamps.State = 1;
                                else
                                    meepo.Move(illusionCamps.WaitPosition);
                                Utils.Sleep(500, "wait");
                                break;
                            case 1:
                                creepscount = CreepCount(illusionCamps.meepos, 800);
                                if (creepscount == 0)
                                {
                                    JungleCamps.Find(x => x.Id == illusionCamps.Id).meepos = null;
                                    JungleCamps.Find(x => x.Id == illusionCamps.Id).Empty = true;
                                    JungleCamps.Find(x => x.Id == illusionCamps.Id).Stacking = false;
                                    JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, true, false).Id).meepos =
                                        meepo;
                                    JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, true, false).Id).Stacking =
                                        true;
                                }
                                else if (seconds >= illusionCamps.Starttime - 5)
                                {
                                    closestNeutral = GetNearestCreepToPull(illusionCamps.meepos, 800);
                                    stackPosition = illusionCamps.StackPosition;
                                    var moveTime = illusionCamps.Starttime -
                                                   (GetDistance2D(illusionCamps.meepos.Position,
                                                       closestNeutral.Position) +
                                                    (closestNeutral.IsRanged
                                                        ? closestNeutral.AttackRange
                                                        : closestNeutral.RingRadius)) / movementspeed;
                                    illusionCamps.AttackTime = (int)moveTime;
                                    illusionCamps.State = 2;
                                }
                                Utils.Sleep(500, "wait");
                                break;
                            case 2:
                                if (seconds >= illusionCamps.AttackTime)
                                {
                                    closestNeutral = GetNearestCreepToPull(illusionCamps.meepos, 1200);
                                    stackPosition = GetClosestCamp(illusionCamps.meepos, true, false).StackPosition;
                                    illusionCamps.meepos.Attack(closestNeutral);
                                    illusionCamps.State = 3;
                                    var tWait =
                                        (int)
                                            (((GetDistance2D(illusionCamps.meepos.Position, closestNeutral.Position)) /
                                              movementspeed) * 1000 + Game.Ping);
                                    Utils.Sleep(tWait, "" + illusionCamps.meepos.Handle);
                                }
                                break;
                            case 3:
                                if (Utils.SleepCheck("" + illusionCamps.meepos.Handle))
                                {
                                    var poof = meepo.Spellbook.SpellW;
                                    if (_menuValue.IsEnabled(poof.Name) && poof.CanBeCasted() &&
                                        Creepcountall(wRadius) > Creepcountall(600) / 2)
                                        poof.UseAbility(meepo);
                                    illusionCamps.meepos.Move(illusionCamps.StackPosition);
                                    illusionCamps.State = 4;
                                }
                                break;
                            case 4:
                                meepo.Move(illusionCamps.StackPosition);
                                Utils.Sleep(1000, "wait");
                                break;
                            default:
                                illusionCamps.State = 0;
                                break;
                        }
                    }
                }

            }
            #endregion Stack

            #region Farm

            else if (JungleFarm && meepos.Count > 0 && Utils.SleepCheck("farm"))
            {
                foreach (var meepo in meepos)
                {
                    if (!Check(meepo))
                    {
                        JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, false, false).Id).meepos = meepo;
                        JungleCamps.Find(x => x.Id == GetClosestCamp(meepo, false, false).Id).Farming = true;
                    }
                    else
                    {
                        var illusionCamps = CheckMeepo(meepo);
                        if (meepo.Distance2D(illusionCamps.Position) > 100)
                        {
                            meepo.Move(illusionCamps.Position);
                        }
                        else
                        {
                            var poof = meepo.Spellbook.SpellW;
                            if (poof.CanBeCasted() && CreepCount(meepo, 300) > 0 && _menuValue.IsEnabled(poof.Name) &&
                                Creepcountall(wRadius) >= Creepcountall(600) / 2)
                                poof.UseAbility(meepo);
                            meepo.Attack(GetNearestCreepToPull(illusionCamps.meepos, 500));
                        }

                    }
                }
                Utils.Sleep(1000, "farm");
            }

            #endregion Farm
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="PriorityChanger" /> struct.
        /// </summary>
        /// <param name="itemList">
        ///     The item list.
        /// </param>
        /// <param name="abilityToggler">
        ///     The ability toggler.
        /// </param>
        /// <param name="changerName">
        ///     The changer name.
        /// </param>
        /// <param name="defaultPriority">
        ///     The default Priority.
        /// </param>
        /// <param name="useAbilityToggler">
        ///     The use ability toggler.
        /// </param>
        public PriorityChanger(
            List <string> itemList,
            AbilityToggler abilityToggler,
            string changerName     = "",
            uint defaultPriority   = 4,
            bool useAbilityToggler = true)
        {
            this.random          = new Random();
            this.itemList        = new List <string>();
            this.defaultPriority = defaultPriority;
            this.maxPriority     = (uint)itemList.Count();
            this.minPriority     = 0;
            this.Dictionary      = new Dictionary <string, uint>();
            var count = 0u;

            this.usingAbilityToggler = useAbilityToggler;
            this.PositionDictionary  = new Dictionary <string, float[]>();
            this.SValuesDictionary   = new Dictionary <string, uint>();
            this.name           = changerName != string.Empty ? changerName : id.ToString();
            this.AbilityToggler = abilityToggler;
            foreach (var s in itemList)
            {
                this.Add(s, count);
                count++;
            }

            //foreach (var v in this.Dictionary.Where(v => !Menu.TextureDictionary.ContainsKey(v.Key)))
            //{
            //    Menu.TextureDictionary.Add(
            //        v.Key,
            //        v.Key.Substring(0, "item".Length) == "item"
            //            ? Textures.GetTexture("materials/ensage_ui/items/" + v.Key.Substring("item_".Length) + ".vmat")
            //            : Textures.GetTexture("materials/ensage_ui/spellicons/" + v.Key + ".vmat"));
            //}

            //var posDict = this.PositionDictionary;
            //foreach (var v in this.Dictionary.Where(v => !posDict.ContainsKey(v.Key)))
            //{
            //    this.PositionDictionary.Add(v.Key, new float[] { 0, 0 });
            //}

            //var saveDict = this.SValuesDictionary;
            //foreach (var v in this.Dictionary.Where(v => !saveDict.ContainsKey(v.Key)))
            //{
            //    this.SValuesDictionary.Add(v.Key, v.Value);
            //}

            if (MenuVariables.DragAndDropDictionary == null)
            {
                MenuVariables.DragAndDropDictionary = new Dictionary <string, DragAndDrop>();
            }

            id++;
            if (!MenuVariables.DragAndDropDictionary.ContainsKey(this.name))
            {
                MenuVariables.DragAndDropDictionary.Add(
                    this.name,
                    new DragAndDrop(MenuSettings.MenuItemHeight, itemList, abilityToggler));
            }

            this.UpdatePriorities();
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="PriorityChanger" /> struct.
        /// </summary>
        /// <param name="itemList">
        ///     The item list.
        /// </param>
        /// <param name="abilityToggler">
        ///     The ability toggler.
        /// </param>
        /// <param name="changerName">
        ///     The changer name.
        /// </param>
        /// <param name="defaultPriority">
        ///     The default Priority.
        /// </param>
        /// <param name="useAbilityToggler">
        ///     The use ability toggler.
        /// </param>
        public PriorityChanger(
            List<string> itemList, 
            AbilityToggler abilityToggler, 
            string changerName = "", 
            uint defaultPriority = 4, 
            bool useAbilityToggler = true)
        {
            this.random = new Random();
            this.itemList = new List<string>();
            this.defaultPriority = defaultPriority;
            this.maxPriority = (uint)itemList.Count();
            this.minPriority = 0;
            this.Dictionary = new Dictionary<string, uint>();
            var count = 0u;
            this.usingAbilityToggler = useAbilityToggler;
            this.PositionDictionary = new Dictionary<string, float[]>();
            this.SValuesDictionary = new Dictionary<string, uint>();
            this.name = changerName != string.Empty ? changerName : id.ToString();
            this.AbilityToggler = abilityToggler;
            foreach (var s in itemList)
            {
                this.Add(s, count);
                count++;
            }

            //foreach (var v in this.Dictionary.Where(v => !Menu.TextureDictionary.ContainsKey(v.Key)))
            //{
            //    Menu.TextureDictionary.Add(
            //        v.Key, 
            //        v.Key.Substring(0, "item".Length) == "item"
            //            ? Textures.GetTexture("materials/ensage_ui/items/" + v.Key.Substring("item_".Length) + ".vmat")
            //            : Textures.GetTexture("materials/ensage_ui/spellicons/" + v.Key + ".vmat"));
            //}

            //var posDict = this.PositionDictionary;
            //foreach (var v in this.Dictionary.Where(v => !posDict.ContainsKey(v.Key)))
            //{
            //    this.PositionDictionary.Add(v.Key, new float[] { 0, 0 });
            //}

            //var saveDict = this.SValuesDictionary;
            //foreach (var v in this.Dictionary.Where(v => !saveDict.ContainsKey(v.Key)))
            //{
            //    this.SValuesDictionary.Add(v.Key, v.Value);
            //}

            if (MenuVariables.DragAndDropDictionary == null)
            {
                MenuVariables.DragAndDropDictionary = new Dictionary<string, DragAndDrop>();
            }

            id++;
            if (!MenuVariables.DragAndDropDictionary.ContainsKey(this.name))
            {
                MenuVariables.DragAndDropDictionary.Add(
                    this.name, 
                    new DragAndDrop(MenuSettings.MenuItemHeight, itemList, abilityToggler));
            }

            this.UpdatePriorities();
        }
Example #8
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (!loaded)
            {
                me = ObjectMgr.LocalHero;
                if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Ursa)
                {
                    return;
                }
                earthshock = me.Spellbook.Spell1;
                overpower = me.Spellbook.SpellW;
                enrage = me.FindSpell("ursa_enrage");
                blink = me.FindItem("item_blink");
                abyssalBlade = me.FindItem("item_abyssal_blade");
                scytheOfVyse = me.FindItem("item_sheepstick");
                loaded = true;
                Game.PrintMessage(
                    "<font color='#3377ff'></font><font face='Tahoma' size='9'><font color='#ff9900'></font></font>",
                    MessageType.ChatMessage);
            }

            if (!Game.IsInGame || me == null)
            {
                overpowerCastPoint = 0;
                earthshockCastPoint = 0;
                loaded = false;
                me = null;
                target = null;
                earthshock = null;
                overpower = null;
                enrage = null;
                abyssalBlade = null;
                scytheOfVyse = null;
                blink = null;
                return;
            }

            if (!menuvalueSet)
            {
                menuValue = Menu.Item("enabledAbilities").GetValue<AbilityToggler>();
                menuvalueSet = true;
                //Utils.Sleep(100000, "updateMenuValue");
            }

            if (Game.IsPaused)
            {
                return;
            }

            if (blink == null)
            {
                blink = me.FindItem("item_blink");
            }

            if (abyssalBlade == null)
            {
                abyssalBlade = me.FindItem("item_abyssal_blade");
            }

            if (abyssalBlade == null)
            {
                abyssalBlade = me.FindItem("item_sheepstick");
            }

            if (earthshock == null)
            {
                earthshock = me.Spellbook.Spell1;
            }
            else if (earthshockCastPoint == 0)
            {
                earthshockCastPoint = 0.3;
            }

            if (overpower == null)
            {
                overpower = me.Spellbook.SpellW;
            }
            else if (overpowerCastPoint == 0)
            {
                overpowerCastPoint = 0.3;
            }

            if (enrage == null)
            {
                enrage = me.FindSpell("ursa_enrage");
            }

            if (!Menu.Item("comboKey").GetValue<KeyBind>().Active || Game.IsChatOpen)
            {
                target = null;
                return;
            }
            if (Utils.SleepCheck("blink"))
            {
                mePosition = me.Position;
            }
            if (earthshock.IsInAbilityPhase
                && (target == null || !target.IsAlive
                    || target.Distance2D(me) > earthshock.GetAbilityData("shock_radius")))
            {
                me.Stop();
                if (target != null)
                {
                    me.Attack(target);
                }
            }
            if (overpower.IsInAbilityPhase && (target == null || !target.IsAlive))
            {
                me.Stop();
                if (target != null)
                {
                    me.Attack(target);
                }
            }
            var range = 1000f;
            var mousePosition = Game.MousePosition;
            if (blink != null)
            {
                blinkRange = blink.AbilityData.FirstOrDefault(x => x.Name == "blink_range").GetValue(0);
                range = blinkRange + me.HullRadius + 500;
            }
            var canCancel = (Orbwalking.CanCancelAnimation() && Orbwalking.AttackOnCooldown(target))
                            || (!Orbwalking.AttackOnCooldown(target)
                                && (targetDistance > 350 || (target != null && !target.IsVisible))) || target == null;
            if (canCancel)
            {
                if (target != null && !target.IsVisible)
                {
                    if (!Menu.Item("lockTarget").GetValue<bool>())
                    {
                        var closestToMouse = me.ClosestToMouseTarget(128);
                        if (closestToMouse != null)
                        {
                            target = me.ClosestToMouseTarget(range);
                        }
                    }
                }
                else
                {
                    var index = Menu.Item("targetSelecting").GetValue<StringList>().SelectedIndex;
                    target = index == 0 ? me.BestAATarget(blinkRange) : me.ClosestToMouseTarget();
                }
            }
            if (target == null || !target.IsAlive
                || ((!target.IsVisible || target.Distance2D(mousePosition) > target.Distance2D(me) + 1000) && canCancel))
            {
                if (!Utils.SleepCheck("move"))
                {
                    return;
                }
                me.Move(mousePosition);
                Utils.Sleep(100, "move");
                return;
            }
            targetDistance = mePosition.Distance2D(target);
            hullsum = (me.HullRadius + target.HullRadius) * 2;
            turnTime = me.GetTurnTime(target);
            var casting = CastCombo();
            if (casting)
            {
                return;
            }
            if (!Utils.SleepCheck("casting"))
            {
                return;
            }
            OrbWalk(Orbwalking.CanCancelAnimation());
        }
Example #9
0
        private static void Main()
        {
            menu = new Menu("Another Snatcher", "anotherSnatcher", true, "rune_doubledamage", true);

            var items = new List<string>
            {
                "item_gem",
                "item_cheese",
                "item_rapier",
                "item_aegis",
                "rune_doubledamage"
            };

            menu.AddItem(new MenuItem("holdSnatchKey", "Hold key").SetValue(new KeyBind('O', KeyBindType.Press)))
                .ValueChanged += (sender, args) => holdKey = args.GetNewValue<KeyBind>().Active;
            menu.AddItem(
                new MenuItem("enabledStealHold", "Hold steal:").SetValue(
                    holdAbilities = new AbilityToggler(items.ToDictionary(x => x, x => true))));
            menu.AddItem(new MenuItem("pressSnatchKey", "Toggle key").SetValue(new KeyBind('P', KeyBindType.Toggle)))
                .ValueChanged += (sender, args) => toggleKey = args.GetNewValue<KeyBind>().Active;
            menu.AddItem(
                new MenuItem("enabledStealToggle", "Toggle steal:").SetValue(
                    toggleAbilities = new AbilityToggler(items.ToDictionary(x => x, x => true))));
            menu.AddItem(new MenuItem("sleep", "Check delay").SetValue(new Slider(200, 0, 500))).ValueChanged +=
                (sender, args) => delay = args.GetNewValue<Slider>().Value;

            toggleKey = menu.Item("pressSnatchKey").GetValue<KeyBind>().Active;
            delay = menu.Item("sleep").GetValue<Slider>().Value;

            menu.AddToMainMenu();

            Events.OnLoad += OnLoad;
            Events.OnClose += OnClose;
        }
Example #10
0
        private static void InitMenu()
        {
            var itemdict = new Dictionary<string, bool>
                           {
                               { "item_veil_of_discord", true }, { "item_shivas_guard", true},
                               { "item_sheepstick", true }, { "item_orchid", true }, { "item_dagon_5", true }, { "item_heavens_halberd", true },
                               { "item_ethereal_blade", true}
                           };
            Menu = new Menu("Zeus#", "Zeus#", true, "npc_dota_hero_zuus", true);
            var comboMenu = new Menu("Combo Tweaks", "combomenu", false, @"..\other\statpop_exclaim", true);
            comboMenu.AddItem(new MenuItem("enabledAbilities", "Items:").SetValue(new AbilityToggler(itemdict)));
            comboMenu.AddItem(
                new MenuItem("blink", "Use Blink").SetValue(true)
                    .SetTooltip("Blinks to target but not closer than specified range."));
            comboMenu.AddItem(
                new MenuItem("refresherToggle", "Use Refresher").SetValue(false)
                    .SetTooltip("Auto use refresher for 2x ultimate."));
            comboMenu.AddItem(
                new MenuItem("arcaneauto", "Auto Arcane Boots").SetValue(false)
                    .SetTooltip("Auto use arcane boots when off CD and mana wouldn't be wasted."));
            comboMenu.AddItem(
                new MenuItem("targetsearchrange", "Target Search Range").SetValue(new Slider(1000, 128, 2500))
                    .SetTooltip("Radius of target search range around cursor."));
            comboMenu.AddItem(
                new MenuItem("saferange", "Blink not closer than").SetValue(new Slider(650, 125, 850))
                    .SetTooltip(
                        "Increases combo range with blink. P.S. No point in blinking in melee to da face. Shoutout to Evervolv1337 ;)"));
            comboMenu.AddItem(
                new MenuItem("Wrealrange", "W Non-target Range").SetValue(new Slider(950, 700, 1050))
                    .SetTooltip("Try to W ground close to enemy giving 1050 max range. Reduce range in case of misses."));

            var stealMenu = new Menu("Ultimate Usage", "stealmenu", false, "zuus_thundergods_wrath", true);
            stealMenu.AddItem(new MenuItem("stealToggle", "Auto Steal").SetValue(new KeyBind(45, KeyBindType.Toggle)).SetTooltip("Auto R on killable."));
            stealMenu.AddItem(
                new MenuItem("confirmSteal", "Manual Steal Key").SetValue(new KeyBind('F', KeyBindType.Press))
                    .SetTooltip("Manual R steal key."));
            stealMenu.AddItem(
                new MenuItem("useRincombo", "Don't steal with R in combo").SetValue(true)
                    .SetTooltip("Use R steal only when NOT in combo."));
            stealMenu.AddItem(new MenuItem("stealEdmg", "Try to add E dmg if possible").SetValue(true));

            var drawMenu = new Menu("Drawings", "drawmenu", false, @"..\other\statpop_star", true);
            drawMenu.AddItem(
                new MenuItem("drawblinkrange", "Draw Combo Blink Range").SetValue(true)
                    .SetTooltip("Uses blink range + safe range."));
            drawMenu.AddItem(new MenuItem("drawQrange", "Draw Q Range").SetValue(true).SetTooltip("Useful for farming."));
            drawMenu.AddItem(
                new MenuItem("drawWrange", "Draw W Real Range").SetValue(true).SetTooltip("Uses W non-targeting range."));
            drawMenu.AddItem(
                new MenuItem("drawblinkready", "Glow When Blink Off CD").SetValue(false)
                    .SetTooltip("Draw glow on zeus when blink dagger is off cooldown."));
            drawMenu.AddItem(
                new MenuItem("drawtargetglow", "Draw Glow On Target").SetValue(false)
                    .SetTooltip("Draw glow on selected target."));

            Menu.AddItem(
                new MenuItem("active", "Combo Key").SetValue(new KeyBind(32, KeyBindType.Press))
                    .SetTooltip("Hold this key for combo."));
            Menu.AddItem(
                new MenuItem("harass", "Harass Key").SetValue(new KeyBind('D', KeyBindType.Press))
                    .SetTooltip("Hold this key for harass. Not uses blink, refresher, hex, halberd, shiva."));
            Menu.AddItem(
                new MenuItem("qFarm", "Farm Key").SetValue(new KeyBind('E', KeyBindType.Press))
                    .SetTooltip("Hold this key to farm with Q."));
            Menu.AddItem(
                new MenuItem("wFarm", "Lasthit with W").SetValue(true)
                    .SetTooltip("Siege, neutrals, forge spirits, Lone Druid bear"));
            Menu.AddSubMenu(comboMenu);
            Menu.AddSubMenu(stealMenu);
            Menu.AddSubMenu(drawMenu);
            Menu.AddToMainMenu();
            menuValue = Menu.Item("enabledAbilities").GetValue<AbilityToggler>();
        }
Example #11
0
        public static void Game_OnUpdate(EventArgs args)
        {
            me = ObjectMgr.LocalHero;

            if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame)
                return;

            if (me.ClassID != ClassID.CDOTA_Unit_Hero_Clinkz)
                return;

            if (me == null)
                return;

            if (arrows == null)
                arrows = me.Spellbook.SpellW;

            if (bkb == null)
                bkb = me.FindItem("item_black_king_bar");

            if (strafe == null)
                strafe = me.Spellbook.Spell1;

            if (hex == null)
                hex = me.FindItem("item_sheepstick");

            if (orchid == null)
                orchid = me.FindItem("item_orchid");

            if (medallion == null)
                medallion = me.FindItem("item_medallion_of_courage");

            if (solar == null)
                solar = me.FindItem("item_solar_crest");

            if (!menuvalueSet)
            {
                menuValue = Menu.Item("Items").GetValue<AbilityToggler>();
                menuvalueSet = true;
            }

            const int DPrange = 0x190;

            var creepR =
                ObjectMgr.GetEntities<Creep>()
                    .Where(
                        creep =>
                            (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
                             creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral) &&
                             creep.IsAlive && creep.IsVisible && creep.IsSpawned &&
                             creep.Team != me.Team && creep.Position.Distance2D(me.Position) <= DPrange &&
                             me.Spellbook.SpellR.CanBeCasted()).ToList();

            if (autoKillz && Menu.Item("enable").GetValue<bool>())
            {

                target = me.ClosestToMouseTarget(0x3e8);

            //orbwalk
            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(0x3e8);
                }

            }

            if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion)
            {

                int attackrange = 0x276;
                if (me.CanAttack() && me.CanCast())
                {

                    if (arrows != null && arrows.IsValid && arrows.CanBeCasted() &&me.CanCast() && Utils.SleepCheck("arrows"))
                    {
                        arrows.UseAbility(target);
                        Utils.Sleep(50, "arrows");
                    }

                    if (strafe != null && strafe.IsValid && strafe.CanBeCasted() && me.CanCast() && me.Distance2D(target) <= 720 &&
                        Utils.SleepCheck("strafe"))

                    {
                        strafe.UseAbility();
                        Utils.Sleep(50 + Game.Ping, "strafe");
                    }

                    if (creepR.Count > 0 && !me.Modifiers.ToList().Exists(x => x.Name == "modifier_clinkz_death_pact"))
                    {
                        var creepmax = creepR.MaxOrDefault(x => x.Health);
                        me.Spellbook.SpellR.UseAbility(creepmax);
                    }

                    if (medallion != null && medallion.IsValid && medallion.CanBeCasted() && Utils.SleepCheck("medallion") && menuValue.IsEnabled(medallion.Name))
                    {
                        medallion.UseAbility(target);
                        Utils.Sleep(50 + Game.Ping, "medallion");
                    }

                    if (solar != null && solar.IsValid && solar.CanBeCasted() && Utils.SleepCheck("solar") && menuValue.IsEnabled(solar.Name))
                    {
                        solar.UseAbility(target);
                        Utils.Sleep(50 + Game.Ping, "solar");
                    }

                    if (bkb != null && bkb.IsValid && bkb.CanBeCasted() && Utils.SleepCheck("bkb") && menuValue.IsEnabled(bkb.Name) && me.Distance2D(target) <= 720)
                    {
                        bkb.UseAbility();
                        Utils.Sleep(150 + Game.Ping, "bkb");
                    }

                    if (hex != null && hex.IsValid && hex.CanBeCasted() && Utils.SleepCheck("hex") && menuValue.IsEnabled(hex.Name))
                    {
                        hex.CastStun(target);
                        Utils.Sleep(250 + Game.Ping, "hex");
                        return;
                    }

                    if (orchid != null && orchid.IsValid && orchid.CanBeCasted() && Utils.SleepCheck("orchid") && menuValue.IsEnabled(orchid.Name))
                    {
                        orchid.CastStun(target);
                        Utils.Sleep(250 + Game.Ping, "orchid");
                        return;
                    }

                    if (arrows == null || arrows.CanBeCasted() || !Utils.SleepCheck("arrows")
                        || !Menu.Item("orbwalk").GetValue<bool>() || !(me.Distance2D(target) <= attackrange))
                    {
                    }
                    else
                    {
                        Orbwalking.Orbwalk(target);
                        Utils.Sleep(Game.Ping + 150, "arrows");
                    }

                    if (me.IsAttacking() || !(me.Distance2D(target) >= attackrange)
                        || !Utils.SleepCheck("follow"))
                    {
                        return;
                    }
                    me.Move(Game.MousePosition);
                    Utils.Sleep(150 + Game.Ping, "follow");
                }

                else if (Utils.SleepCheck("strafe") && !arrows.CanBeCasted() && Utils.SleepCheck("arrows"))
                {
                    me.Attack(target);
                    Utils.Sleep(150, "strafe");
                }

            }
            else
            {
                me.Move(Game.MousePosition);
            }
            }
        }
Example #12
0
        public PriorityChanger(List <string> itemList, string changerName = "", bool useAbilityToggler = false)
        {
            this.itemList        = itemList;
            this.defaultPriority = 4;
            this.maxPriority     = (uint)itemList.Count();
            this.minPriority     = 0;
            this.Dictionary      = new Dictionary <string, uint>();
            var count = 0u;

            this.usingAbilityToggler = useAbilityToggler;
            foreach (var s in itemList)
            {
                this.Dictionary.Add(s, count);
                count++;
            }

            this.PositionDictionary = new Dictionary <string, float[]>();
            this.SValuesDictionary  = new Dictionary <string, uint>();
            foreach (var v in this.Dictionary.Where(v => !Menu.TextureDictionary.ContainsKey(v.Key)))
            {
                Menu.TextureDictionary.Add(
                    v.Key,
                    v.Key.Substring(0, "item".Length) == "item"
                        ? Drawing.GetTexture("materials/ensage_ui/items/" + v.Key.Substring("item_".Length) + ".vmat")
                        : Drawing.GetTexture("materials/ensage_ui/spellicons/" + v.Key + ".vmat"));
            }

            var posDict = this.PositionDictionary;

            foreach (var v in this.Dictionary.Where(v => !posDict.ContainsKey(v.Key)))
            {
                this.PositionDictionary.Add(v.Key, new float[] { 0, 0 });
            }

            var saveDict = this.SValuesDictionary;

            foreach (var v in this.Dictionary.Where(v => !saveDict.ContainsKey(v.Key)))
            {
                this.SValuesDictionary.Add(v.Key, v.Value);
            }

            if (MenuVariables.DragAndDropDictionary == null)
            {
                MenuVariables.DragAndDropDictionary = new Dictionary <string, DragAndDrop>();
            }

            this.AbilityToggler = new AbilityToggler(new Dictionary <string, bool>());
            if (useAbilityToggler)
            {
                foreach (var item in itemList)
                {
                    this.AbilityToggler.Add(item);
                }
            }

            this.name = changerName != string.Empty ? changerName : id.ToString();
            id++;
            if (!MenuVariables.DragAndDropDictionary.ContainsKey(this.name))
            {
                MenuVariables.DragAndDropDictionary.Add(
                    this.name,
                    useAbilityToggler
                        ? new DragAndDrop(MenuSettings.MenuItemHeight, itemList, this.AbilityToggler)
                        : new DragAndDrop(MenuSettings.MenuItemHeight, itemList));
            }
            else
            {
                foreach (var u in
                         new Dictionary <PriorityIcon, uint>(
                             MenuVariables.DragAndDropDictionary[this.name].PriorityIconsDictionary).Where(
                             u => !itemList.Contains(u.Key.Name)))
                {
                    MenuVariables.DragAndDropDictionary[this.name].Remove(u.Key.Name);
                }

                MenuVariables.DragAndDropDictionary[this.name].UpdateOrder();
            }

            this.UpdatePriorities();
        }