Example #1
0
        private async void TestButton_Click(object sender, RoutedEventArgs e)
        {
            //testimg.Source = new BitmapImage(new Uri("C:\\Users\\Brandon Duong\\Music\\vlive1.jpg"));
            if (started)
            {
                stop       = true;
                timer.Text = "Attempting to stop...";
                return;
            }
            console_box.Clear();
            timer.Text = "Attempting to start...";
            await Task.Delay(500);

            if (!SettingsView.getQuick())
            {
                setName();
            }
            current = 0;
            total   = 0;
            string dank;

            string[] array;
            started            = true;
            TestButton.Content = "STOP";
            for (int i = 0; i < 6; i++)
            {
                dank  = PrivateView.getText(i);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                if (i == 1)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 4800;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }
                if (i == 2)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 2700;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }
                if (i == 3)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 1380;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }
                if (i == 4)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 960;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }
                if (i == 5)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 360;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }

                if (i == 0)
                {
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 120;
                    total += (int)Math.Ceiling((double)((array.Length - 1)) / 15) * 180;
                }
                //total += array.Length-1;
                //console_box.Text += (array.Length-1) + "\n";
            }
            if (total == 0)
            {
                timer.Text         = "NEED LINKS BOI";
                group.Text         = "NEED LINKS BOI";
                started            = false;
                TestButton.Content = "START";
                return;
            }
            for (int i = 0; i < 6; i++)
            {
                dank   = PrivateView.getText(i);
                array  = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                total += (array.Length - 1) * 15;
                //total += array.Length-1;
                //console_box.Text += (array.Length-1) + "\n";
            }
            total           = total * PrivateView.getLoops();
            percentage.Text = ((current / total) * 100).ToString() + "%";
            percent         = (double)((double)current / (double)total);;

            for (int k = 0; k < PrivateView.getLoops(); k++)
            {
                console_box.Text += "::::::LOOP " + (k + 1) + "::::::\n";
                int counter = 0;
                dank  = PrivateView.getText(1);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------ONE HOUR----------//
                if (array.Length <= 1)
                {
                    goto thirtyminsec;
                }
                console_box.Text += "----ONE HOUR SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }

                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    await Task.Delay(2500);

                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 4800; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (4799 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text = "Closing links.." + (179 - x);
                            await Task.Delay(1000);

                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 4800; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (4799 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "";

thirtyminsec:
                dank  = PrivateView.getText(2);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------THIRTY MINTUES----------//
                if (array.Length <= 1)
                {
                    goto twentyminsec;
                }
                console_box.Text += "----THIRTY MINTUE SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    await Task.Delay(2500);

                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 2700; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (2699 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text      = "Closing links.." + (179 - x);
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 2700; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (2699 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "";

twentyminsec:
                dank  = PrivateView.getText(3);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------TWENTY MINUTES----------//
                if (array.Length <= 1)
                {
                    goto tenminsec;
                }
                console_box.Text += "----TWENTY MINUTE SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    await Task.Delay(2500);

                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 1380; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (1379 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text      = "Closing links.." + (179 - x);
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 1380; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (1379 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "";

tenminsec:
                dank  = PrivateView.getText(4);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------TEN MINUTES----------//
                if (array.Length <= 1)
                {
                    goto fiveminsec;
                }
                console_box.Text += "----TEN MINUTE SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    await Task.Delay(2500);

                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 960; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (959 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }

                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text      = "Closing links.." + (179 - x);
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 960; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (959 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "";

fiveminsec:
                dank  = PrivateView.getText(5);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------FIVE MINUTES----------//
                if (array.Length <= 1)
                {
                    goto oneminsec;
                }
                console_box.Text += "----FIVE MINUTE SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    await Task.Delay(2500);

                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 360; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (359 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }

                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text      = "Closing links.." + (179 - x);
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 360; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (359 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "";

oneminsec:
                dank  = PrivateView.getText(6);
                array = dank.Split(new string[] { "\n" }, StringSplitOptions.None);
                //-----------ONE MINUTE----------//
                console_box.Text += "----ONE MINUTE SECTION----\n";
                for (int i = 0; i < array.Length - 1; i++)
                {
                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                    timer.Text        = "Opening link " + (i + 1) + "/" + (array.Length - 1);
                    console_box.Text += (i + 1) + ". " + array[i] + "\n";
                    System.Diagnostics.Process.Start("microsoft-edge:" + array[i]);
                    await Task.Delay(2500);

                    counter++;
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString();
                    for (int a = 0; a < 15; a++)
                    {
                        percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                        percent         = (double)((double)current / (double)total);
                        await Task.Delay(10);
                    }
                    if (counter > 14)
                    {
                        for (int x = 0; x < 120; x++)
                        {
                            timer.Text      = "Sleep time remaining: " + (119 - x) + " seconds";
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }

                        timer.Text = "Closing links..";
                        closeTabs(counter);
                        counter = 0;
                        for (int x = 0; x < 180; x++)
                        {
                            timer.Text      = "Closing links.." + (179 - x);
                            percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                            percent         = (double)((double)current / (double)total);
                            await Task.Delay(1000);

                            if (stop)
                            {
                                started            = false;
                                stop               = false;
                                TestButton.Content = "START";
                                timer.Text         = "";
                                return;
                            }
                        }
                        timer.Text = "";
                    }
                }
                for (int x = 0; x < 120; x++)
                {
                    timer.Text      = "Sleep time remaining: " + (119 - x) + " seconds";
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                timer.Text = "Closing links..";
                closeTabs(counter);
                counter = 0;
                await Task.Delay(180000);

                for (int x = 0; x < 180; x++)
                {
                    timer.Text      = "Closing links.." + (179 - x);
                    percentage.Text = ((double)((double)++current / (double)total) * 100).ToString("##0.000") + "%";
                    percent         = (double)((double)current / (double)total);
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
                for (int a = 0; a < 600; a++)
                {
                    timer.Text = "Loop " + (k + 1) + " finished. Next loop in " + (599 - a) + "s";
                    await Task.Delay(1000);

                    if (stop)
                    {
                        started            = false;
                        stop               = false;
                        TestButton.Content = "START";
                        timer.Text         = "";
                        return;
                    }
                }
            }
            started            = false;
            TestButton.Content = "START";
            timer.Text         = "";
        }