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); } }
void Start() { allowedToCreateCharacter = false; cm = cursor.GetComponent <CursorMover>(); selectedGameObject = cm.GetSelectedOption(); selectedCharacter = selectedGameObject; selectedText = selectedGameObject.GetComponent <Text>(); // selectedSlot = 0; }
void Awake() { prefabHandler = GameObject.Find("StatusBoxHandler").GetComponent <MenuPrefabHandler>(); menuHandler = GameObject.Find("MenuHandler").GetComponent <MenuHandler>(); cursor = gameObject; string parent = cursor.transform.parent.name; cm = gameObject.GetComponent <CursorMover>(); selectedOption = cm.GetSelectedOption(); menuHandler.SetCursor(cursor); }
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); }
// Use this for initialization void Awake() { reachedMaxStats = false; // selectedSlot = characterSelect.GetSelectedCharacter(); handler = GameObject.Find("StatusBoxHandler"); characterMenuPrefabHandler = handler.GetComponent <CharacterMenuPrefabHandler>(); animator = gameObject.GetComponent <Animator>(); cursorInput = gameObject.GetComponent <CursorInput>(); cm = gameObject.GetComponent <CursorMover>(); animator.enabled = false; statSelected = false; statCounter = int.Parse(statsLeft.GetComponent <Text>().text); totalStatsAllowed = (ushort)(statCounter + 5); }