Пример #1
0
        public void SaveIni()
        {
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.MinRandomBots", " " + txbMinbot.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.MaxRandomBots", " " + txbMaxBot.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.MinRandomBotsPerInterval", " " + txbMinBotInter.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.MaxRandomBotsPerInterval", " " + txbMaxBotInter.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotAccountCount", " " + txbBotAccount.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotMinLevel", " " + txbMinLevel.Text);
            _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotMaxLevel", " " + txbMaxLevel.Text);

            try
            {
                switch (cbDel.Checked)
                {
                case true:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.DeleteRandomBotAccounts", " 1");
                    break;

                case false:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.DeleteRandomBotAccounts", " 0");
                    break;
                }
                switch (cbJoin.Checked)
                {
                case true:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotJoinLfg", " 1");
                    break;

                case false:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotJoinLfg", " 0");
                    break;
                }

                switch (cbBots.Text)
                {
                case "Enabled":
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.Enabled", " 1");

                    break;

                case "Disabled":
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.Enabled", " 0");
                    break;
                }

                switch (cbAHbot.Text)
                {
                case "Enabled":
                    _ahbot.Write("AhbotConf", "AuctionHouseBot.Seller.Enabled", " 1");
                    _ahbot.Write("AhbotConf", "AuctionHouseBot.Buyer.Enabled", " 1");

                    break;

                case "Disabled":
                    _ahbot.Write("AhbotConf", "AuctionHouseBot.Seller.Enabled", " 0");
                    _ahbot.Write("AhbotConf", "AuctionHouseBot.Buyer.Enabled", " 0");
                    break;
                }

                switch (cbRndBotLgn.Checked)
                {
                case true:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotLoginAtStartup", " 1");
                    break;

                case false:
                    _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotLoginAtStartup", " 0");
                    break;
                }

                string[] arr = new string[4];

                if (cbEastern.Checked)
                {
                    arr[0] = "0";
                }

                if (cbKalimdor.Checked)
                {
                    arr[1] = "1";
                }

                if (cbNorthrend.Checked)
                {
                    arr[2] = "571";
                }

                if (cbOutland.Checked)
                {
                    arr[3] = "530";
                }

                var res = String.Join(",", arr.Where(s => !string.IsNullOrEmpty(s)));

                _aiplayerbot.Write("AiPlayerbotConf", "AiPlayerbot.RandomBotMaps", " " + res);
            }
            catch (Exception)
            {
                MessageBox.Show("Some exception: write", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            MessageBox.Show(!_defaultL ? Resources.BotConf_SaveIni_ : Resources.BotConf_SaveIni_default, "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                MyIni.Write("MangosdConf", "StartPlayerLevel", " " + txbLevel.Text);
                MyIni.Write("MangosdConf", "StartPlayerMoney", " " + txbMoney.Text);
                MyIni.Write("MangosdConf", "StartHonorPoints", " " + txbHonor.Text);
                MyIni.Write("MangosdConf", "StartArenaPoints", " " + txbArena.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Poor", " " + txbPoor.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Normal", " " + txbNormal.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Uncommon", " " + txbUncommon.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Rare", " " + txbRare.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Legendary", " " + txbLegendary.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Artifact", " " + txbArtifact.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Referenced", " " + txbReferenced.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Item.Epic", " " + txbEpic.Text);
                MyIni.Write("MangosdConf", "Rate.Drop.Money", " " + txbMoneyRate.Text);
                MyIni.Write("MangosdConf", "Rate.XP.Kill", " " + txbKillRate.Text);
                MyIni.Write("MangosdConf", "Rate.XP.Quest", " " + txbQuestRate.Text);
                MyIni.Write("MangosdConf", "Rate.XP.Explore", " " + txbExploreRate.Text);
                MyIni.Write("MangosdConf", "Rate.Honor", " " + txbHonorRate.Text);
                MyIni.Write("MangosdConf", "Rate.Talent", " " + txbTalentRate.Text);

                switch (cbPaths.Text)
                {
                case "Enabled":
                    MyIni.Write("MangosdConf", "AllFlightPaths", " " + "1");
                    break;

                case "Disabled":
                    MyIni.Write("MangosdConf", "AllFlightPaths", " " + "0");
                    break;
                }
            }
            catch
            {
                MessageBox.Show("Some exception: write", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            MessageBox.Show("World Settings Saved.\nThe changes to take effect, server restart requiered.", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }