private void launchbtn_Click(object sender, EventArgs e) { try { service = ChromeDriverService.CreateDefaultService(); service.HideCommandPromptWindow = true; ChromeOptions options = new ChromeOptions(); options.AddArgument("user-data-dir=" + "Profiles/" + (server.Text + domain.Text + nameBox.Text).ToLower()); string url = http.Text + server.Text + trav.Text + domain.Text + "/"; browser = new TravianBrowser(service, options, nameBox.Text, passBox.Text, url); Thread t1 = new Thread(browser.LoginTravian); t1.Start(); this.Hide(); var TaskScreen = new TaskScreen(browser); TaskScreen.Owner = this; TaskScreen.Show(); TaskScreen.Show(); } catch (Exception ex) { this.Show(); MessageBox.Show(ex.Message, "Error creating new browser class"); } }
public TaskScreen(TravianBrowser tb) { InitializeComponent(); initialise_timers(); DoingTaskBuildList = new List <TravianDoingTaskBuild>(); TaskBuildBuildList = new List <TravianTaskBuild>(); VillageList = new List <TravianVillage>(); this.tb = tb; counter = 0; timerlbl.Text = counter.ToString(); }