Esempio n. 1
0
 static void Main(string[] args)
 {
     Bootstrap.Init();
     Hacks.UseGameObjectCache = true;
     Events.OnLoad           += (sender, loadArgs) =>
     {
         if (Game.MapId != GameMapId.SummonersRift)
         {
             // halt
             return;
         }
         SessionBasedData.LoadTick = ObjectManager.Get <Obj_AI_Minion>().Any(m => m.CharData.BaseSkinName.Contains("Minion"))
             ? Environment.TickCount - 190000
             : Environment.TickCount;
         UniversalLeveler.Program.Init();
         Hotfixes.Load();
         Logging.Log("LOADED " + SessionBasedData.LoadTick);
         Game.OnUpdate += (updateArgs) =>
         {
             if (Environment.TickCount - SessionBasedData.LoadTick > 15000)
             {
                 Tree.Seed();
                 Tree.Water();
             }
             else
             {
                 Logging.Log("WAITING FOR GAME START");
             }
         };
         Game.OnEnd += endArgs =>
         {
             Task.Run(
                 async() =>
             {
                 await Task.Delay(5000);
                 Game.Quit();
             });
         };
     };
 }
Esempio n. 2
0
        public static void Main()
        {
            if (Game.MapId != GameMapId.SummonersRift || Game.MapId == GameMapId.HowlingAbyss)
            {
                return;
            }

            Chat.Print("SharpAI has loaded!");

            Bootstrap.Init();
            r = new System.Random();

            SessionBasedData.LoadTick = ObjectManager.Get <Obj_AI_Minion>().Any(m => m.CharData.BaseSkinName.Contains("Minion"))
                ? Environment.TickCount - 190000
                : Environment.TickCount;

            Hotfixes.Load();

            Logging.Log("LOADED " + SessionBasedData.LoadTick);

            Game.OnUpdate += (updateArgs) =>
            {
                if (Environment.TickCount - SessionBasedData.LoadTick > 15000)
                {
                    Tree.Seed();
                    Tree.Water();
                }
                else
                {
                    Logging.Log("WAITING FOR GAME START");
                }
            };

            var gameEndNotified = false;

            Game.OnTick += delegate
            {
                if (gameEndNotified)
                {
                    return;
                }
                var nexus = ObjectManager.Get <Obj_HQ>();
                if (nexus == null)
                {
                    return;
                }
                if (nexus.Any(n => n.IsDead || n.Health.Equals(0)))
                {
                    var win = ObjectManager.Get <Obj_HQ>().Any(n => n.Health.Equals(0));
                    OnGameEnd?.Invoke(win);
                    gameEndNotified = true;
                }
            };

            OnGameEnd += endArgs =>
            {
                Task.Run(
                    async() =>
                {
                    await Task.Delay(10000);
                    Game.QuitGame();
                });
            };
        }