Exemplo n.º 1
0
        /// <summary>
        /// Applies settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonApply_Click(object sender, EventArgs e)
        {
            try
            {
                string size           = "";
                string refreshChecked = "";
                string refreshRadio   = "";
                string autoRadio      = "";

                int clicker = int.Parse(textBoxAutoClicker.Text);
                if (radioButtonClickMilliseconds.Checked == false)
                {
                    clicker = 50;
                }

                if (textBoxWidth.Text != "" && textBoxHeight.Text != "" && clicker > 49)
                {
                    int milSeconds = 0;

                    //Client Sizing settings
                    if (radioButtonSmall.Checked == true)
                    {
                        clientSize("s");
                        size = "small";
                    }
                    else if (radioButtonMedium.Checked == true)
                    {
                        clientSize("m");
                        size = "medium";
                    }
                    else if (radioButtonLarge.Checked == true)
                    {
                        clientSize("l");
                        size = "large";
                    }

                    //Refresh Settings
                    if (textBoxRefresh.Text != "")
                    {
                        if (checkBoxRefresh.Checked == true)
                        {
                            if (radioButtonRefreshSeconds.Checked == true)
                            {
                                milSeconds   = (int.Parse(textBoxRefresh.Text) * 1000);
                                refreshRadio = "seconds";
                            }
                            else if (radioButtonRefreshMinutes.Checked == true)
                            {
                                milSeconds   = (int.Parse(textBoxRefresh.Text) * 60000);
                                refreshRadio = "minutes";
                            }
                            //MessageBox.Show(milSeconds.ToString());
                            _form1.enableTimer(milSeconds, true);
                            refreshChecked = "checked";
                        }

                        if (radioButtonRefreshSeconds.Checked == true)
                        {
                            refreshRadio = "seconds";
                        }
                        else if (radioButtonRefreshMinutes.Checked == true)
                        {
                            refreshRadio = "minutes";
                        }

                        if (checkBoxRefresh.Checked == false)
                        {
                            if (radioButtonRefreshSeconds.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 1000);
                                autoRadio  = "milliseconds";
                            }
                            else if (radioButtonRefreshMinutes.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 60000);
                                autoRadio  = "seconds";
                            }
                            //MessageBox.Show(milSeconds.ToString());
                            _form1.enableTimer(milSeconds, false);
                            refreshChecked = "unchecked";
                        }
                    }
                    //Auto Clicker settings
                    if (textBoxAutoClicker.Text != null)
                    {
                        if (radioButtonClickMilliseconds.Checked == true)
                        {
                            int milliSeconds = int.Parse(textBoxAutoClicker.Text);
                            //MessageBox.Show(milliSeconds.ToString());
                            _form1.autoClicker(milliSeconds);
                        }
                        else if (radioButtonClickSeconds.Checked == true)
                        {
                            int milliSeconds = (int.Parse(textBoxAutoClicker.Text) * 1000);
                            //MessageBox.Show(milliSeconds.ToString());
                            _form1.autoClicker(milliSeconds);
                        }
                    }

                    applyDetails = (size + "," + refreshChecked + "," +
                                    textBoxRefresh.Text + "," + refreshRadio + "," + textBoxAutoClicker.Text + "," + autoRadio);
                    MessageBox.Show("Settings applied.");
                }
                else
                {
                    MessageBox.Show("Please enter a width and height with a minimum click interval of 50 milliseconds.");
                }
            }
            catch
            {
                MessageBox.Show("Please enter a width and height with a minimum click interval of 50 milliseconds.");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Applies settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonApply_Click(object sender, EventArgs e)
        {
            try
            {
                int clicker = int.Parse(textBoxAutoClicker.Text);
                if (radioButtonClickMilliseconds.Checked == false)
                {
                    clicker = 50;
                }

                if (textBoxWidth.Text != "" && textBoxHeight.Text != "" && clicker > 49)
                {
                    int milSeconds = 0;

                    //Refresh Settings
                    if (textBoxRefresh.Text != "")
                    {
                        if (checkBoxRefresh.Checked == true)
                        {
                            if (radioButtonRefreshSeconds.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 1000);
                            }
                            else if (radioButtonRefreshMinutes.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 60000);
                            }
                            //MessageBox.Show(milSeconds.ToString());
                            _form1.enableTimer(milSeconds, true);
                        }
                        else if (checkBoxRefresh.Checked == false)
                        {
                            if (radioButtonRefreshSeconds.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 1000);
                            }
                            else if (radioButtonRefreshMinutes.Checked == true)
                            {
                                milSeconds = (int.Parse(textBoxRefresh.Text) * 60000);
                            }
                            //MessageBox.Show(milSeconds.ToString());
                            _form1.enableTimer(milSeconds, false);
                        }
                    }
                    //Auto Clicker settings
                    if (textBoxAutoClicker.Text != null)
                    {
                        if (radioButtonClickMilliseconds.Checked == true)
                        {
                            int milliSeconds = int.Parse(textBoxAutoClicker.Text);
                            //MessageBox.Show(milliSeconds.ToString());
                            _form1.autoClicker(milliSeconds);
                        }
                        else if (radioButtonClickSeconds.Checked == true)
                        {
                            int milliSeconds = (int.Parse(textBoxAutoClicker.Text) * 1000);
                            //MessageBox.Show(milliSeconds.ToString());
                            _form1.autoClicker(milliSeconds);
                        }
                    }

                    MessageBox.Show("Settings applied.");
                }
                else
                {
                    MessageBox.Show("Please enter a width and height with a minimum click interval of 50 milliseconds.");
                }
            }
            catch
            {
                MessageBox.Show("Please enter a width and height with a minimum click interval of 50 milliseconds.");
            }
        }