Пример #1
0
        private void MoveMouseRelative(int dx, int dy)
        {
            var trail  = trails.GetRandomTrail();
            var matrix = ExtraMath.GetMatrix(dx, dy, trail.DX, trail.DY);
            var moves  = trail.Moves;

            var first = moves[0];
            var time  = first.Time;

            var start = User32.GetCursorPosition();

            foreach (var m in moves)
            {
                Thread.Sleep(m.Time - time);

                time = m.Time;

                var p = ExtraMath.MultiplyMatrix22ToPoint(matrix, m.X - first.X, m.Y - first.Y);

                DoMouseMoveAbsolute(start.X + p.X, start.Y + p.Y, m.Type);
            }
        }