コード例 #1
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                // Setup Console
                console = new ConsoleForm();
                console.StartPosition = FormStartPosition.Manual;                
                console.Location = new System.Drawing.Point((Screen.PrimaryScreen.Bounds.Width / 2) - 530, (Screen.PrimaryScreen.Bounds.Height / 2) + 310);                

                // Start Loading
                StartLogger();
                CleanUp();

                // Begin Process
                await DisplayLoginWindow();                
                DisplayPositionSelector();
                await GetStorageSizes();
                await GetCurrentPlayerInformation();
                await PreflightCheck();

                _recycleItemTimer = new System.Timers.Timer(5 * 60 * 1000); // 5 Minute timer
                _recycleItemTimer.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Logger.Write(ex.Message);
            }

            _recycleItemTimer.Elapsed += _recycleItemTimer_Elapsed;
        }
コード例 #2
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                // Setup Console
                console = new ConsoleForm();
                console.StartPosition = FormStartPosition.Manual;                
                console.Location = new System.Drawing.Point((Screen.PrimaryScreen.Bounds.Width / 2) - 530, (Screen.PrimaryScreen.Bounds.Height / 2) + 310);

                // Start Loading
                StartLogger();
                CleanUp();

                // Begin Process
                if (!await DisplayLoginWindow())
                    throw new LoginNotSelectedException("Unable to Login");

                DisplayPositionSelector();
                await GetStorageSizes();
                await GetCurrentPlayerInformation();
                await PreflightCheck();

                // Starts the Timer for the Silent Recycle
                _recycleItemTimer = new System.Timers.Timer(5 * 60 * 1000); // 5 Minute timer
                _recycleItemTimer.Start();
                _recycleItemTimer.Elapsed += _recycleItemTimer_Elapsed;
                StartAppUsageReporting();
            }
            catch (LoginNotSelectedException ex)
            {
                MessageBox.Show(ex.Message, "PoGo Bot");
                Application.Exit();
            }
            catch (Exception ex)
            {
                ErrorReportCreator.Create("BotLoadingError", "Unable to Load the Bot", ex);
                MessageBox.Show("Unable to Start the Bot.", "PoGo Bot");
                Application.Exit();
            }            
        }
コード例 #3
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                // Setup Console
                console = new ConsoleForm();
                console.StartPosition = FormStartPosition.Manual;                
                console.Location = new System.Drawing.Point((Screen.PrimaryScreen.Bounds.Width / 2) - 530, (Screen.PrimaryScreen.Bounds.Height / 2) + 310);

                // Start Loading
                StartLogger();
                CleanUp();

                // Begin Process
                await DisplayLoginWindow();                
                DisplayPositionSelector();
                await GetStorageSizes();
                await GetCurrentPlayerInformation();
                await PreflightCheck();

                // Starts the Timer for the Silent Recycle
                _recycleItemTimer = new System.Timers.Timer(5 * 60 * 1000); // 5 Minute timer
                _recycleItemTimer.Start();
            }
            catch (LoginNotSelectedException ex)
            {
                MessageBox.Show(ex.Message, "PoGo Bot");
                Application.Exit();
            }
            catch (Exception ex)
            {
                // Exception Notification
                APINotifications.SendNotification($"{ex.Message}{Environment.NewLine}{ex.StackTrace}", $"App Loading: {ex.GetType()}", 0);
                MessageBox.Show("Unable to Start the Bot.", "PoGo Bot");
                Application.Exit();
            }

            _recycleItemTimer.Elapsed += _recycleItemTimer_Elapsed;
        }