示例#1
0
        public static void SetViewAngles(Rotator ang)
        {
            if (ang == new Rotator(0, 0, 0))
            {
                return;
            }
            if (MouseAim)
            {
                Vector2 Aim   = Main.cameraManager.WorldToScreen(ang.ToVector(), screensize);
                var     point = new System.Drawing.Point((int)Aim.X, (int)Aim.Y);

                var delay = TimeSpan.FromMilliseconds(1);

                CursorMover.MoveCursor(point, delay);
            }
            else
            {
                if (aimbot)
                {
                    Main.LocalPlayer.SetViewAngles(ang);
                }
            }
            if (SilentAim)
            {
                Main.playerController.SetViewAngles(ang);
            }
        }
示例#2
0
        public void TestRuntime(int x, int y, int milliseconds)
        {
            var point     = new Point(x, y);
            var stopwatch = Stopwatch.StartNew();

            CursorMover.MoveCursor(point, TimeSpan.FromMilliseconds(milliseconds));
            stopwatch.Stop();

            // The runtime duration needs to be buffered to account for the movement initialisation

            Assert.InRange(stopwatch.ElapsedMilliseconds, milliseconds, milliseconds + _runtimeBuffer);
        }
示例#3
0
        public void TestDelay(int x, int y, int milliseconds)
        {
            var point = new Point(x, y);

            var stopwatch = Stopwatch.StartNew();

            CursorMover.MoveCursor(point, TimeSpan.FromMilliseconds(milliseconds));

            stopwatch.Stop();

            Assert.InRange(stopwatch.ElapsedMilliseconds, milliseconds, milliseconds + 80);
        }
示例#4
0
        public void TestMovement(int x, int y)
        {
            var point = new Point(x, y);

            CursorMover.MoveCursor(point, TimeSpan.FromMilliseconds(1));

            if (!User32.GetCursorPos(out var currentCursorPosition))
            {
                throw new Win32Exception();
            }

            Assert.Equal(point, currentCursorPosition);
        }