コード例 #1
0
        public static List <GameBot> LoadBotsFromFile()
        {
            var result = new List <GameBot>();

            if (!File.Exists("accounts.txt"))
            {
                return(result);
            }
            using (var reader = new StreamReader("accounts.txt"))
            {
                try
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        var bot = new GameBot();
                        bot.LoadFromString(line);
                        result.Add(bot);
                    }
                }
                catch (Exception)
                {
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: uvbs/SteamSummerGameBot
 private void BotOnOnLog(GameBot sender, string s)
 {
     Invoke((MethodInvoker)(() =>
     {
         lbLog.Items.Add(string.Format("[{0}] [{1}] : {2}", DateTime.Now, sender.Name, s));
         lbLog.SelectedIndex = lbLog.Items.Count - 1;
     }));
 }
コード例 #3
0
        private void btnAuth_Click(object sender, EventArgs e)
        {
            //Если нет бота, создадим
            if (Bot == null)
            {
                Bot = new GameBot();
            }
            //Откроем форму браузера
            var authForm = new BrowserForm(Bot);

            authForm.Show(this);
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: uvbs/SteamSummerGameBot
 private void BotOnOnHp(GameBot sender, string s)
 {
     Invoke((MethodInvoker)(() => lblHp.Text = s));
 }
コード例 #5
0
 public BrowserForm(GameBot bot)
 {
     InitializeComponent();
     _bot = bot;
 }