Ejemplo n.º 1
0
        private void StopAutoClicker()
        {
            autoClickerEnabled = false;
            EnableAutoClickerUIButtons(true);
            AutoClickerStatusLabel.Text      = "OFF";
            AutoClickerStatusLabel.ForeColor = Color.Red;
            ToggleAutoClickerButton.FlatAppearance.BorderColor = Color.Red;
            ToggleAutoClickerButton.FlatAppearance.BorderSize  = 1;
            AutoClickerTimer.Stop();

            if (limitAutoClicker)
            {
                LimitAutoClickerProgressTitle.Visible = false;
                LimitAutoClickerProgressLabel.Visible = false;
            }

            if (settings["StartAutoClickerHotkey"].ToLower() == "already in use" || settings["StartAutoClickerHotkey"].ToLower() == "none")
            {
                ToggleAutoClickerButton.Text = "Start AutoClicker";
            }
            else
            {
                ToggleAutoClickerButton.Text = "Start AutoClicker\n(Hotkey: " + settings["StartAutoClickerHotkey"] + ")";
            }
        }
Ejemplo n.º 2
0
        private void StartAutoClicker()
        {
            AutoClickerInputTextBox_Validated(null, null);
            if (int.Parse(AutoClickerInputTextBox.Text) == 0)
            {
                return;
            }
            autoClickerEnabled = true;
            EnableAutoClickerUIButtons(false);
            AutoClickerStatusLabel.Text      = "ON";
            AutoClickerStatusLabel.ForeColor = Color.Green;
            ToggleAutoClickerButton.FlatAppearance.BorderColor = Color.Green;
            ToggleAutoClickerButton.FlatAppearance.BorderSize  = 2;

            if (bool.Parse(settings["SameHotkeyForAutoClicker"]))
            {
                if (settings["StartAutoClickerHotkey"].ToLower() == "already in use" || settings["StartAutoClickerHotkey"].ToLower() == "none")
                {
                    ToggleAutoClickerButton.Text = "Stop AutoClicker";
                }
                else
                {
                    ToggleAutoClickerButton.Text = "Stop AutoClicker\n(Hotkey: " + settings["StartAutoClickerHotkey"] + ")";
                }
            }
            else
            {
                if (settings["StopAutoClickerHotkey"].ToLower() == "already in use" || settings["StopAutoClickerHotkey"].ToLower() == "none")
                {
                    ToggleAutoClickerButton.Text = "Stop AutoClicker";
                }
                else
                {
                    ToggleAutoClickerButton.Text = "Stop AutoClicker\n(Hotkey: " + settings["StopAutoClickerHotkey"] + ")";
                }
            }

            if (autoClickerDelayMode)
            {
                AutoClickerTimer.Interval = (int)Math.Ceiling(1000f * float.Parse(AutoClickerInputTextBox.Text));
            }
            else
            {
                AutoClickerTimer.Interval = (int)Math.Ceiling(1000f / float.Parse(AutoClickerInputTextBox.Text));
            }

            if (limitAutoClicker)
            {
                LimitAutoClickerProgressTitle.Visible = true;
                LimitAutoClickerProgressLabel.Visible = true;
                LimitAutoClickerProgressLabel.Text    = "";

                if (LimitAutoClickerTypeHours.Checked)
                {
                    limitAutoClickerTime = int.Parse(LimitAutoClickerTextbox.Text) * 60 * 60;
                }
                else if (LimitAutoClickerTypeMinutes.Checked)
                {
                    limitAutoClickerTime = int.Parse(LimitAutoClickerTextbox.Text) * 60;
                }
                else
                {
                    limitAutoClickerTime = int.Parse(LimitAutoClickerTextbox.Text);
                }
            }

            if (bool.Parse(settings["DelayAutoClicker"]))
            {
                if (!autoClickerDelayMode)
                {
                    AutoClickerDelayCounter = (int)Math.Ceiling(1000f / AutoClickerTimer.Interval);
                }
            }

            autoClickerActiveTime       = 0;
            mouseLastPosition           = new int[] { Cursor.Position.X, Cursor.Position.Y };
            autoClickerClickWhileMoving = bool.Parse(settings["ClickWhileMoving"]);
            AutoClickerTimer.Start();
        }