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); } }
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); }
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); }
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); }