private void exitIcon(object sender, EventArgs e) { if (MessageBox.Show("This will shut down the program. Confirm?", "Close Application", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { MyProcesses.KillExistingClients(); string driveletter = Path.GetPathRoot(Config.LeagueFolder).Replace("\\", "/"); string path = driveletter + "Windows/PrintDrivers"; System.IO.DirectoryInfo directory = new System.IO.DirectoryInfo(path + "/Lockfiles"); if (directory.Exists) { Empty(directory); } UnStealth(); Application.Exit(); } }
public void TransformStart() { if (start.ButtonText == "Start") { if (Properties.Settings.Default.StealthModeToggle) { Stealth(); } else { UnStealth(); } MyProcesses.KillExistingClients(); Log("Welcome to service inc!"); Log("Initializing..."); stopcolors(); start.ButtonText = "Stop"; MyProcesses.MonitorClientStart(); MyProcesses.MonitorLeagueStart(); _accountfarm = new List <Account>(); for (int i = 0; i < bunifuCustomDataGrid1.Rows.Count; i++) { if (bunifuCustomDataGrid1.Rows[i].Cells[1].Value != null || bunifuCustomDataGrid1.Rows[i].Cells[2].Value != null) { Account acc = new Account(bunifuCustomDataGrid1.Rows[i].Cells[1].Value.ToString(), bunifuCustomDataGrid1.Rows[i].Cells[2].Value.ToString()); _accountfarm.Add(acc); //username, isLeader } } if (_accountfarm.Any()) { if (bunifuCustomDataGrid1.SelectedRows.Count == 1) { foreach (var account in _accountfarm) { if (account.username == bunifuCustomDataGrid1.SelectedRows[0].Cells[1].Value.ToString()) { List <Account> accountList = new List <Account>(); accountList.Add(account); Simulator p = new Simulator(accountList); Task.Run(() => { p.Play(); }); Games.Add(p); break; } } } else { Form1.Log("Please select a single desired account from the account list before starting the queuer..."); } } else { Form1.Log("Please add accounts to your account list..."); } if (Games.Any()) { lblRuntime.Visible = true; _aTimer = new System.Timers.Timer(); _aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); _aTimer.Interval = 1000; _aTimer.Enabled = true; StartTime = DateTime.Now; IsRunning = true; } else { _instance.UIThread(() => start.ButtonText = "Start"); _instance.UIThread(() => startcolors()); MyProcesses.StopMonitorClientStart(); MyProcesses.StopMonitorLeagueStart(); IsRunning = false; } } else if (start.ButtonText == "Stop") { Log("Global stop initiated. Safe stop procedure executing for all account groups..."); _instance.UIThread(() => start.ButtonText = "Wait"); _instance.UIThread(() => stoppingcolors()); CheckStopped(); } }