Beispiel #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);
        }
Beispiel #2
0
 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;
     }));
 }
        private void btnAuth_Click(object sender, EventArgs e)
        {
            //Если нет бота, создадим
            if (Bot == null)
            {
                Bot = new GameBot();
            }
            //Откроем форму браузера
            var authForm = new BrowserForm(Bot);

            authForm.Show(this);
        }
Beispiel #4
0
 private void BotOnOnHp(GameBot sender, string s)
 {
     Invoke((MethodInvoker)(() => lblHp.Text = s));
 }
Beispiel #5
0
 public BrowserForm(GameBot bot)
 {
     InitializeComponent();
     _bot = bot;
 }