Exemple #1
0
        static void Main(string[] args)
        {
            Console.Clear();
            CustomEvents.Game.OnGameLoad += load =>
            {
                //Start caching objects
                Creatures.Load();
                Structures.Load();

                //Check for updates
                Helpers.Updater();

                //Initialize AutoLeveler
                new AutoLevel(LevelSequences.GetSequence().Select(num => num - 1).ToArray());
                AutoLevel.Enable();

                //Load Champion Plugin
                new PluginLoader();
            };
            Game.OnUpdate += tick =>
            {
                EasyPositioning.Update();
                Behaviors.Tree.Root.Tick();
            };
        }
Exemple #2
0
 private static void OnChange(object sender, OnValueChangeEventArgs e)
 {
     if (e.GetNewValue <bool>())
     {
         AutoLevel.Enable();
     }
     else
     {
         AutoLevel.Disable();
     }
 }
Exemple #3
0
 public static void Checks()
 {
     //Updates the auto-leveling sequence each time (redundant)
     List<SpellSlot> SKILL_SEQUENCE = new List<SpellSlot>() { SpellSlot.Q, SpellSlot.E, SpellSlot.E, SpellSlot.W, SpellSlot.E, SpellSlot.R, SpellSlot.E, SpellSlot.Q, SpellSlot.E, SpellSlot.Q, SpellSlot.R, SpellSlot.Q, SpellSlot.Q, SpellSlot.W, SpellSlot.W, SpellSlot.R, SpellSlot.W, SpellSlot.W };
     AutoLevel.UpdateSequence(SKILL_SEQUENCE);
     //Enables if user selects yes else disables
     if (Program.menuController.getMenu().Item("autoLevel").GetValue<bool>())
         AutoLevel.Enable();
     else
         AutoLevel.Disable();
 }
Exemple #4
0
 private void Game_OnUpdate(EventArgs args)
 {
     if (enabled && configMenu.Item(player.ChampionName + "Enabled").GetValue <bool>())
     {
         AutoLevel.UpdateSequence(GetTree(configMenu.Item(player.ChampionName + "order", true).GetValue <StringList>().SelectedIndex));
         AutoLevel.Enable();
     }
     else
     {
         AutoLevel.Disable();
     }
 }
Exemple #5
0
 public static void OnLoad(EventArgs args)
 {
     AutoLevel.UpdateSequence(new List <SpellSlot>()
     {
         SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.R, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.R, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.Unknown, SpellSlot.R
     });
     _menu = new Menu("AutoUltLeveling", "menu", true);
     _menu.AddItem(new MenuItem("autoultlevel_activate", "Auto Ult Leveling").SetValue(true));
     _menu.AddItem(new MenuItem("42424242", "Credits - Romesti"));
     _menu.Item("autoultlevel_activate").ValueChanged += OnChange;
     AutoLevel.Enable();
     _menu.AddToMainMenu();
 }
Exemple #6
0
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if (!Menu.Item("Enabled", true).IsActive())
            {
                return;
            }

            AutoLevel.Enable();

            if (SequenceDiffers(AutoLevel.GetSequence(), Sequence))
            {
                AutoLevel.UpdateSequence(Sequence);
            }
        }
Exemple #7
0
        private static void OnGameLoad(EventArgs args)
        {
            _loaded   = (Bot.Level == 1) ? Environment.TickCount:Environment.TickCount - 140000;
            _stepTime = Environment.TickCount;
            var map = Utility.Map.GetMap();

            if (map != null && map.Type == Utility.Map.MapType.SummonersRift)
            {
                if (Bot.Team == GameObjectTeam.Order)
                {
                    _chosen      = Blue + Rand.Next(-76, 76);
                    _safe        = Purple + Rand.Next(-67, 67);
                    BotLanePos.X = 11376 + Rand.Next(-50, 50);
                    BotLanePos.Y = 1062 + Rand.Next(-50, 50);
                    TopLanePos.X = 1302 + Rand.Next(-50, 50);
                    TopLanePos.Y = 10249 + Rand.Next(-50, 50);
                }
                if (Bot.Team == GameObjectTeam.Chaos)
                {
                    _chosen      = Purple + Rand.Next(-67, 67);
                    _safe        = Blue + Rand.Next(-76, 76);
                    BotLanePos.X = 13496 + Rand.Next(-50, 50);
                    BotLanePos.Y = 4218 + Rand.Next(-50, 50);
                    TopLanePos.X = 4849 + Rand.Next(-50, 50);
                    TopLanePos.Y = 13535 + Rand.Next(-50, 50);
                }
            }
            else
            {
                _byPassLoadedCheck = true;
                if (Bot.Team == GameObjectTeam.Order)
                {
                    _chosen = Blue;
                    _safe   = Purple;
                }
                if (Bot.Team == GameObjectTeam.Chaos)
                {
                    _chosen = Purple;
                    _safe   = Blue;
                }
            }
            new AutoLevel(TreesAutoLevel.GetSequence().Select(l => l - 1));
            AutoLevel.Enable();
            FileHandler.DoChecks();
            MetaHandler.LoadObjects();
        }
Exemple #8
0
        private static void OnGameLoad(EventArgs args)
        {
            _loaded   = (Bot.Level == 1) ? Environment.TickCount:Environment.TickCount - 140000;
            _stepTime = Environment.TickCount;
            var map = Utility.Map.GetMap();

            if (map.Type == Utility.Map.MapType.SummonersRift)
            {
                //Initialize
                var condition = Bot.Team == GameObjectTeam.Order;
                _chosen    = condition ? Blue : Purple;
                _safe      = condition ? Purple : Blue;
                BotLanePos = condition ? new Vector2(11376, 1062).To3D() : new Vector2(13496, 4218).To3D();
                TopLanePos = condition ? new Vector2(1302, 10249).To3D() : new Vector2(4849, 13535).To3D();

                //Randomize:
                _chosen   += Rand.Next(-100, 100);
                _safe     += Rand.Next(-100, 100);
                TopLanePos = TopLanePos.Randomize(-150, 150);
                BotLanePos = BotLanePos.Randomize(-150, 150);
            }
            else
            {
                _byPassLoadedCheck = true;
                var condition = Bot.Team == GameObjectTeam.Order;
                _chosen = condition ? Blue : Purple;
                _safe   = condition ? Purple : Blue;

                //Randomize:
                _chosen += Rand.Next(-100, 100);
                _safe   += Rand.Next(-100, 100);
            }
            new AutoLevel(TreesAutoLevel.GetSequence().Select(l => l - 1));
            AutoLevel.Enable();
            MetaHandler.LoadObjects();
        }
Exemple #9
0
 public static void Load()
 {
     Events.OnLoad += (obj, loadArgs) =>
     {
         Shop.Main.Init();
         _autoLevel = new AutoLevel(AutoLevel.GetSequenceFromDb());
         _autoLevel.Enable();
         Obj_AI_Base.OnIssueOrder += (sender, issueOrderArgs) =>
         {
             if (SessionBasedData.Loaded && sender.IsMe)
             {
                 if (issueOrderArgs.Order == GameObjectOrder.MoveTo && ObjectManager.Player.Distance(issueOrderArgs.TargetPosition) < 1000)
                 {
                     if (ObjectManager.Player.IsRecalling() ||
                         (ObjectManager.Player.InFountain() && ObjectManager.Player.HealthPercent < 95))
                     {
                         Logging.Log("bot is recalling");
                         issueOrderArgs.Process = false;
                         return;
                     }
                     if (issueOrderArgs.TargetPosition.IsDangerousPosition())
                     {
                         Logging.Log("target position is dangerous");
                         issueOrderArgs.Process = false;
                         return;
                     }
                     if (Environment.TickCount - _lastMovementCommand > Utility.Random.GetRandomInteger(300, 1100))
                     {
                         Logging.Log("humanizing");
                         _lastMovementCommand = Environment.TickCount;
                         return;
                     }
                     issueOrderArgs.Process = false;
                 }
                 if (issueOrderArgs.Target != null)
                 {
                     if (issueOrderArgs.Target is Obj_AI_Hero)
                     {
                         Logging.Log("anti outtraded");
                         if (ObjectManager.Player.IsUnderEnemyTurret() || (ObjectManager.Get <Obj_AI_Minion>().Count(m => m.IsEnemy && !m.IsDead && m.Distance(ObjectManager.Player) < 600) > 4 && Variables.Orbwalker.ActiveMode != OrbwalkingMode.Combo))
                         {
                             issueOrderArgs.Process = false;
                             return;
                         }
                     }
                     if (issueOrderArgs.Target is Obj_AI_Minion && (issueOrderArgs.Target as Obj_AI_Minion).Team == GameObjectTeam.Neutral)
                     {
                         Logging.Log("skipped hitting jg camp");
                         issueOrderArgs.Process = false;
                         return;
                     }
                 }
             }
         };
         Spellbook.OnCastSpell += (sender, castSpellArgs) =>
         {
             if (castSpellArgs.Slot == SpellSlot.Recall)
             {
                 Variables.Orbwalker.ActiveMode = OrbwalkingMode.None;
             }
         };
         Obj_AI_Base.OnProcessSpellCast += (sender, spellCastArgs) =>
         {
             if (Variables.Orbwalker.ActiveMode != OrbwalkingMode.Combo && spellCastArgs.Target != null && spellCastArgs.Target.IsMe)
             {
                 if (sender is Obj_AI_Minion)
                 {
                     AttackedByMinionsFlag = true;
                     DelayAction.Add(350, () => AttackedByMinionsFlag = false);
                 }
                 if (sender is Obj_AI_Turret)
                 {
                     AttackedByTurretFlag = true;
                     DelayAction.Add(500, () => AttackedByTurretFlag = false);
                 }
             }
         };
         Game.OnUpdate += args =>
         {
             if (ObjectManager.Player.IsRecalling() ||
                 (ObjectManager.Player.InFountain() && ObjectManager.Player.HealthPercent < 95))
             {
                 Variables.Orbwalker.ActiveMode = OrbwalkingMode.None;
                 return;
             }
             if (ObjectManager.Player.Position.IsDangerousPosition())
             {
                 AttackedByMinionsFlag = true;
                 DelayAction.Add(350, () => AttackedByMinionsFlag = false);
             }
         };
         Variables.Orbwalker.OnAction += (sender, args) =>
         {
             if (ObjectManager.Player.IsRecalling())
             {
                 args.Process = false;
                 Variables.Orbwalker.ActiveMode = OrbwalkingMode.None;
             }
             if (Environment.TickCount - _lastAfkCheckTime > 30000)
             {
                 _lastAfkCheckTime = Environment.TickCount;
                 if (_lastAfkCheckPosition.Distance(ObjectManager.Player.ServerPosition) < 400)
                 {
                     var pos = new Utility.Geometry.Circle(ObjectManager.Player.Position.ToVector2(), 500).ToPolygon().GetRandomPointInPolygon();
                     pos.WalkToPoint(OrbwalkingMode.None, true);
                 }
                 _lastAfkCheckPosition = ObjectManager.Player.ServerPosition;
             }
         };
     };
 }
 public AutoLeveler(int[] tree)
 {
     autoLevel = new AutoLevel(tree);
     AutoLevel.Enable();
 }
Exemple #11
0
        /// <summary>
        /// 0-delay initialization
        /// </summary>
        public static void DoFullInitialization()
        {
            Core.MainMenu = new Menu("MySharpSupport", "mysharpsupport", true);
            Core.MainMenu.AddItem(
                new MenuItem("mycarryis", "ADC to Follow").SetValue(
                    new StringList(
                        ObjectManager.Get <Obj_AI_Hero>()
                        .Where(h => h.IsAlly && !h.IsMe)
                        .OrderByDescending(a => a.Spellbook.Spells.Any(s => s.Name == "SummonerHeal"))
                        .Select(hero => hero.ChampionName)
                        .ToArray())));
            Core.MainMenu.AddItem(
                new MenuItem("maxdistfromcarry", "Max Distance from Carry: ").SetValue(
                    new Slider(
                        Math.Min(
                            Math.Min((int)ObjectManager.Player.GetSpell(SpellSlot.Q).SData.CastRange,
                                     (int)ObjectManager.Player.GetSpell(SpellSlot.W).SData.CastRange),
                            (int)ObjectManager.Player.GetSpell(SpellSlot.E).SData.CastRange), 100, 800)));
            Core.MainMenu.AddItem(
                new MenuItem("startingitem", "Starting Item").SetValue(
                    new StringList(new[] { "AncientCoin", "RelicShield", "SpellthiefsEdge" })));
            Core.MainMenu.AddItem(
                new MenuItem("firstitem", "First Item").SetValue(
                    new StringList(new[]
            {
                "Sightstone", "TalismanOfAscension", "FrostQueensClaim", "FaceOfTheMountain", "ZekesHarbinger",
                "LocketOfTheIronSolari", "MikaelsCrucible", "ZhonyasHourglass", "Morellonomicon", "RodOfAges"
            })));
            Core.MainMenu.AddItem(
                new MenuItem("seconditem", "Second Item").SetValue(
                    new StringList(new[]
            {
                "TalismanOfAscension", "Sightstone", "FrostQueensClaim", "FaceOfTheMountain", "ZekesHarbinger",
                "LocketOfTheIronSolari", "MikaelsCrucible", "ZhonyasHourglass", "Morellonomicon", "RodOfAges"
            })));
            Core.MainMenu.AddItem(
                new MenuItem("thirditem", "Third Item").SetValue(
                    new StringList(new[]
            {
                "ZekesHarbinger", "TalismanOfAscension", "Sightstone", "FrostQueensClaim", "FaceOfTheMountain",
                "LocketOfTheIronSolari", "MikaelsCrucible", "ZhonyasHourglass", "Morellonomicon", "RodOfAges"
            })));
            Core.MainMenu.AddItem(
                new MenuItem("fourthitem", "Fourth Item").SetValue(
                    new StringList(new[]
            {
                "TalismanOfAscension", "Sightstone", "FrostQueensClaim", "FaceOfTheMountain", "ZekesHarbinger",
                "LocketOfTheIronSolari", "MikaelsCrucible", "ZhonyasHourglass", "Morellonomicon", "RodOfAges"
            })));
            Core.MainMenu.AddItem(
                new MenuItem("fifthitem", "Fifth Item").SetValue(
                    new StringList(new[]
            {
                "LocketOfTheIronSolari", "TalismanOfAscension", "Sightstone", "FrostQueensClaim",
                "FaceOfTheMountain", "ZekesHarbinger", "MikaelsCrucible", "ZhonyasHourglass", "Morellonomicon",
                "RodOfAges"
            })));
            Core.MainMenu.AddItem(
                new MenuItem("sixthitem", "Sixth Item").SetValue(
                    new StringList(new[]
            {
                "MikaelsCrucible", "LocketOfTheIronSolari", "TalismanOfAscension", "Sightstone",
                "FrostQueensClaim",
                "FaceOfTheMountain", "ZekesHarbinger", "ZhonyasHourglass", "Morellonomicon",
                "RodOfAges"
            })));
            Core.MainMenu.AddToMainMenu();

            Game.OnUpdate += Core.OnUpdate;
            Game.OnChat   += ChatCommands.OnChat;
            new AutoLevel(TreesAutoLevel.GetSequence().Select(l => l - 1));
            AutoLevel.Enable();
        }