Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (BotList.Count == 0)
            {
                MessageBox.Show("No Bots Added!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            if (!IsStarted)
            {
                MessageBox.Show("Bots aren't started yet!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            int Amount = BotList.Count;

            foreach (Thread Bot in BotList)
            {
                Bot.Abort(1);
            }
            Program.botRunning = false;
            BotList.Clear();
            WindowList.Clear();
            listView1.Items.Clear();
            IsStarted = false;
            PreventSleepMode.ToggleSleepMode(false);
            MessageBox.Show($"{Amount} Bots have been Stopped and removed from List!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }