コード例 #1
0
        public void Stop()
        {
            try {
                WindowState = FormWindowState.Normal;

                Thread[] threads = { _leftClickThread, _rightClickThread, _customClickThread, _multipleListsThread };
                foreach (Thread thread in threads)
                {
                    ShutdownThread(thread);
                }

                if (_holdLeftMouseButton || _holdRightMouseButton)
                {
                    if (_holdLeftMouseButton)
                    {
                        _mouseEventData.ReleaseMouse("left");
                    }
                    else
                    {
                        _mouseEventData.ReleaseMouse("right");
                    }
                }

                _isRunning = false;
                _activeKey = Keys.None;

                if (_holdCTRL)
                {
                    MouseEventData.keybd_event(MouseEventData.VK_CONTROL, 0, MouseEventData.KEYEVENTF_KEYUP, 0);
                }
            } catch (ThreadAbortException ex) {
                Console.WriteLine("Error terminating threads: " + ex);
            }
        }
コード例 #2
0
        public void Run()
        {
            int count = 0;

            try {
                while (true)
                {
                    foreach (ClickPosition click in _clickPositions)
                    {
                        count++;
                        MouseEventData.LinearSmoothMove(new Point(click.X, click.Y), 5, 10, click.MouseButton);

                        Thread.Sleep((int)(_clickInterval * 1000));
                    }

                    var success = SingleLoopEvent;
                    if (success != null)
                    {
                        success();
                        break;
                    }
                }
            } catch (Exception exc) {
                //MessageBox.Show(exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        public void Run()
        {
            try {
                while (true)
                {
                    foreach (ClickCollection collection in _clickCollections)
                    {
                        foreach (ClickPosition click in collection.Clicks)
                        {
                            MouseEventData.LinearSmoothMove(new Point(click.X, click.Y), 5, 10, click.MouseButton);

                            Thread.Sleep((int)(collection.ClickInterval * 1000));
                        }
                    }
                }
            } catch (Exception exc) {
                Console.WriteLine(exc.Message);
            }
        }
コード例 #4
0
 public void Run()
 {
     if (_holdMouse)
     {
         _mouseEvents.HoldDownMouse("left");
         return;
     }
     try {
         while (true)
         {
             if (_holdCTRL)
             {
                 MouseEventData.keybd_event(MouseEventData.VK_CONTROL, 0, 0, 0); // HOLD DOWN CONTROL
             }
             _mouseEvents.ClickLeftMouseButtonEvent();
             Thread.Sleep((int)(_mouseEvents.GetRandomizedClickSpeed(_randomize, _leftClickSpeed, _randomizationAmount) * 1000));
         }
     } catch (Exception exc) {
         //MessageBox.Show(exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }