Esempio n. 1
0
        public static bool IsGameModeValid(string gameMode)
        {
            switch (gameMode.ToUpper())
            {
            case "INTRO_BOT": return(true);

            case "BEGINNER_BOT": return(true);

            case "MEDIUM_BOT": return(true);

            case "BOT_3X3": return(true);

            case "NORMAL_5X5": return(true);

            case "NORMAL_3X3": return(true);

            case "ARAM": return(true);

            case "ASCENSION_5X5": return(true);

            case "HEXAKILL": return(true);

            case "BOT_URF_5X5": return(true);

            case "URF_5X5": return(true);

            case "ONEFORALL_MIRRORMODE_5X5": return(true);

            case "BILGEWATER_ARAM_5X5": return(true);

            case "KING_PORO_5X5": return(true);

            case "BILGEWATER_5X5": return(true);

            case "SIEGE": return(true);

            case "DEFINITELY_NOT_DOMINION_5X5": return(true);

            case "ARURF_5X5": return(true);
            }

            Tools.ConsoleMessage(Translator.GameModeInvalid, ConsoleColor.Red);
            Tools.ConsoleMessage("INTRO_BOT", ConsoleColor.Red);
            Tools.ConsoleMessage("BEGINNER_BOT", ConsoleColor.Red);
            Tools.ConsoleMessage("MEDIUM_BOT", ConsoleColor.Red);
            Tools.ConsoleMessage("BOT_3X3", ConsoleColor.Red);
            Tools.ConsoleMessage("NORMAL_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("NORMAL_3X3", ConsoleColor.Red);
            Tools.ConsoleMessage("ARAM", ConsoleColor.Red);

            Tools.ConsoleMessage("ASCENSION_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("HEXAKILL", ConsoleColor.Red);
            Tools.ConsoleMessage("BOT_URF_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("URF_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("ONEFORALL_MIRRORMODE_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("BILGEWATER_ARAM_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("KING_PORO_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("BILGEWATER_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("SIEGE", ConsoleColor.Red);
            Tools.ConsoleMessage("DEFINITELY_NOT_DOMINION_5X5", ConsoleColor.Red);
            Tools.ConsoleMessage("ARURF_5X5", ConsoleColor.Red);

            return(false);
        }
Esempio n. 2
0
        public static void LoadConfigs()
        {
            try
            {
                IniFile iniFile = new IniFile(AppDomain.CurrentDomain.BaseDirectory + "configs\\settings.ini");
                try
                {
                    lolPath = iniFile.Read("GENERAL", "LauncherPath");
                    if (string.IsNullOrEmpty(lolPath))
                    {
                        iniFile.Write("GENERAL", "LauncherPath", "C:\\Riot Games\\League of Legends\\");
                        lolPath = "C:\\Riot Games\\League of Legends\\";
                    }
                }
                catch (Exception ex)
                {
                    iniFile.Write("GENERAL", "LauncherPath", "C:\\Riot Games\\League of Legends\\");
                    lolPath = "C:\\Riot Games\\League of Legends\\";
                    Tools.Log(ex.StackTrace);
                }
                try
                {
                    lolPath            = iniFile.Read("GENERAL", "LauncherPath");
                    maxBots            = Convert.ToInt32(iniFile.Read("GENERAL", "MaxBots"));
                    maxLevel           = Convert.ToInt32(iniFile.Read("GENERAL", "MaxLevel"));
                    randomSpell        = Convert.ToBoolean(iniFile.Read("GENERAL", "RandomSpell"));
                    spell1             = iniFile.Read("GENERAL", "Spell1").ToUpper();
                    spell2             = iniFile.Read("GENERAL", "Spell2").ToUpper();
                    delay1             = Convert.ToInt32(iniFile.Read("ACCOUNT", "MinDelay"));
                    delay2             = Convert.ToInt32(iniFile.Read("ACCOUNT", "MaxDelay"));
                    buyExpBoost        = Convert.ToBoolean(iniFile.Read("ACCOUNT", "BuyExpBoost"));
                    randomChampionPick = Convert.ToBoolean(iniFile.Read("CHAMPIONS", "PickRandomlyFromThisList"));
                    firstChampionPick  = iniFile.Read("CHAMPIONS", "FirstChampionPick");
                    secondChampionPick = iniFile.Read("CHAMPIONS", "SecondChampionPick");
                    thirdChampionPick  = iniFile.Read("CHAMPIONS", "ThirdChampionPick");
                    fourthChampionPick = iniFile.Read("CHAMPIONS", "FourthChampionPick");
                    fifthChampionPick  = iniFile.Read("CHAMPIONS", "FifthChampionPick");
                    replaceConfig      = Convert.ToBoolean(iniFile.Read("LOLSCREEN", "ReplaceLoLConfig"));
                    lolHeight          = Convert.ToInt32(iniFile.Read("LOLSCREEN", "SreenHeight"));
                    lolWidth           = Convert.ToInt32(iniFile.Read("LOLSCREEN", "SreenWidth"));
                    LOWPriority        = Convert.ToBoolean(iniFile.Read("LOLSCREEN", "LOWPriority"));
                }
                catch (Exception ex)
                {
                    Tools.ConsoleMessage(ex.StackTrace, ConsoleColor.Red, false);
                }

                try
                {
                    lowGraphics = Convert.ToBoolean(iniFile.Read("LOLSCREEN", "LOWGraphics"));
                }
                catch (Exception ex)
                {
                    iniFile.Write("LOLSCREEN", "LOWGraphics", "false");
                    Tools.Log(ex.StackTrace);
                }

                try
                {
                    queueWithFriends = Convert.ToBoolean(iniFile.Read("FRIENDS", "QueueWithFriends"));
                    leaderName       = iniFile.Read("FRIENDS", "LeaderName");
                    firstFriend      = iniFile.Read("FRIENDS", "FirstFriend");
                    secondFriend     = iniFile.Read("FRIENDS", "SecondFriend");
                    thirdFriend      = iniFile.Read("FRIENDS", "ThirdFriend");
                    fourthFriend     = iniFile.Read("FRIENDS", "FourthFriend");
                }
                catch (Exception ex)
                {
                    iniFile.Write("FRIENDS", "QueueWithFriends", "false");
                    iniFile.Write("FRIENDS", "LeaderName", "");
                    iniFile.Write("FRIENDS", "FirstFriend", "");
                    iniFile.Write("FRIENDS", "SecondFriend", "");
                    iniFile.Write("FRIENDS", "ThirdFriend", "");
                    iniFile.Write("FRIENDS", "FourthFriend", "");
                    Tools.Log(ex.StackTrace);
                }
                try
                {
                    printGameStats = Convert.ToBoolean(iniFile.Read("GENERAL", "PrintGameStats"));
                }
                catch (Exception ex)
                {
                    iniFile.Write("GENERAL", "PrintGameStats", "false");
                    Tools.Log(ex.StackTrace);
                }
                try
                {
                    lolGarenaPath = iniFile.Read("GENERAL", "GarenaLoLFolder");
                    if (string.IsNullOrEmpty(lolGarenaPath))
                    {
                        iniFile.Write("GENERAL", "GarenaLoLFolder", "C:\\GarenaLoL\\GameData\\Apps\\LoL\\");
                        lolGarenaPath = "C:\\GarenaLoL\\GameData\\Apps\\LoL\\";
                    }
                }
                catch (Exception ex)
                {
                    iniFile.Write("GENERAL", "GarenaLoLFolder", "C:\\GarenaLoL\\GameData\\Apps\\LoL\\");
                    lolGarenaPath = "C:\\GarenaLoL\\GameData\\Apps\\LoL\\";
                    Tools.Log(ex.StackTrace);
                }
                try
                {
                    shutdownAfterXMatch = Convert.ToInt32(iniFile.Read("SHUTDOWN", "AfterXGames"));
                    shutdownComputer    = Convert.ToBoolean(iniFile.Read("SHUTDOWN", "AlsoCloseComputer"));
                }
                catch (Exception ex)
                {
                    iniFile.Write("SHUTDOWN", "AfterXGames", "0");
                    iniFile.Write("SHUTDOWN", "AlsoCloseComputer", "false");
                    Tools.Log(ex.StackTrace);
                }

                try
                {
                    language = iniFile.Read("GENERAL", "Language");
                    if (string.IsNullOrEmpty(language))
                    {
                        iniFile.Write("GENERAL", "Language", "en");
                        language = "en";
                    }
                }
                catch (Exception ex)
                {
                    iniFile.Write("GENERAL", "Language", "en");
                    Tools.Log(ex.StackTrace);
                    language = "en";
                }
            }
            catch (Exception ex)
            {
                Tools.Log(ex.Message);
                Thread.Sleep(10000);
                Application.Exit();
            }
        }
Esempio n. 3
0
        private static void Main(string[] args)
        {
            EzBotVersion = LoadEzBotVersion();
            var remoteVersion = LoadRemoteVersion();

            if (string.IsNullOrEmpty(EzBotVersion) || string.IsNullOrEmpty(remoteVersion) || EzBotVersion != remoteVersion)
            {
                Process.Start("AutoUpdater.exe");
                Environment.Exit(0);
            }

            LoadLeagueVersion();

            LoadConfigs();

            LoadTranslator();

            Console.Title = "ezBot";
            Tools.TitleMessage(string.Format(Translator.EzBot, LoLVersion.Substring(0, 4)));
            Tools.TitleMessage(Translator.By);
            Tools.TitleMessage(string.Format(Translator.Version, EzBotVersion));
            Tools.ConsoleMessage("Skype: wisahesa", ConsoleColor.Magenta);
            Tools.ConsoleMessage("Paypal: [email protected]", ConsoleColor.Magenta);
            Tools.ConsoleMessage(Translator.Support, ConsoleColor.Magenta);
            Tools.ConsoleMessage(Translator.Garena, ConsoleColor.Cyan);

            Tools.ConsoleMessage(Translator.SourceCode, ConsoleColor.Cyan);
            Tools.ConsoleMessage(Translator.Issues, ConsoleColor.Cyan);

            if (!IsUserAdministrator())
            {
                Tools.ConsoleMessage(Translator.AdministratorRequired, ConsoleColor.Red);
                Console.ReadKey(true);
                return;
            }

            Tools.ConsoleMessage(Translator.ConfigLoaded, ConsoleColor.White);

            try
            {
                var dir = Directory.EnumerateDirectories(lolPath + "RADS\\solutions\\lol_game_client_sln\\releases\\").OrderBy(f => new DirectoryInfo(f).CreationTime).Last() + "\\deploy\\";
            }catch (Exception)
            {
                Tools.ConsoleMessage(Translator.LauncherPathInvalid, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.PleaseTryThis, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.LauncherFix1, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.LauncherFix2, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.LauncherFix3, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.LauncherFix4, ConsoleColor.Red);
                Tools.ConsoleMessage(Translator.LauncherFix5, ConsoleColor.Red);
            }

            if (replaceConfig)
            {
                Tools.ConsoleMessage(Translator.ChangingGameConfig, ConsoleColor.White);
                ChangeGameConfig();
            }
            Tools.ConsoleMessage(Translator.LoadingAccounts, ConsoleColor.White);
            LoadAccounts();
            int num = 0;

            lock (accounts)
            {
                foreach (string account in accounts)
                {
                    try
                    {
                        accountsNew.RemoveAt(0);
                        string[] strArray = account.Split(new string[1] {
                            "|"
                        }, StringSplitOptions.None);
                        ++num;
                        var isLeader = strArray[4] != null ? (strArray[4].ToLower() == "leader" ? true : false) : true;
                        if (strArray[3] != null)
                        {
                            Generator.CreateRandomThread(delay1, delay2);
                            string queueType = strArray[3];

                            var region   = Tools.ParseEnum <Region>(strArray[2].ToUpper());
                            var password = strArray[1];
                            if (region.UseGarena())
                            {
                                password = GetGarenaToken();
                            }
                            if (IsGameModeValid(queueType))
                            {
                                ezBot ezBot = new ezBot(strArray[0], password, strArray[2].ToUpper(), queueType.ToUpper(), LoLVersion, isLeader);
                            }
                        }
                        else
                        {
                            Generator.CreateRandomThread(delay1, delay2);
                            string queueType = "ARAM";
                            ezBot  ezBot     = new ezBot(strArray[0], strArray[1], strArray[2].ToUpper(), queueType.ToUpper(), LoLVersion, isLeader);
                        }
                        if (num == maxBots)
                        {
                            Tools.ConsoleMessage(string.Format(Translator.MaximumBotsRunning, maxBots), ConsoleColor.Red);
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        Tools.ConsoleMessage(ex.Message + " " + ex.StackTrace, ConsoleColor.Green);
                        Tools.ConsoleMessage(Translator.YouMayHaveAnIssueInAccountsFile, ConsoleColor.Red);
                        Tools.ConsoleMessage(Translator.AccountsStructure, ConsoleColor.Red);
                        Console.ReadKey(true);
                    }
                }
            }

            while (true)
            {
                Console.ReadKey(true);
            }
        }