private void SearchForTarget() { if (target == null) { SendKey.Send(ConstController.WindowsVirtualKey.VK_TAB); } }
public void Update() { if ((DateTime.UtcNow - previousRefreshTime) > TimeSpan.FromMilliseconds(50)) { previousRefreshTime = DateTime.UtcNow; tick++; Refresh(); SetGrinderState(); if (lastState == State.Combat && mode == State.Killing) { SendKey.Send(ConstController.WindowsVirtualKey.K_W); } switch (mode) { case State.Killing: KillTarget(); return; case State.Combat: if (target != null) { MoveToCommand(target.Position); } else { SendKey.Send(ConstController.WindowsVirtualKey.VK_TAB); } return; case State.Rejuvenate: Rejuvenate(); break; case State.Reposition: SearchForTarget(); if (IsAtTarget(checkpoints[atCP], 5)) { atCP = (atCP + 1) >= checkpoints.Count ? 0 : atCP + 1; } MoveToCommand(checkpoints[atCP]); break; case State.Loot: MoveToCommand(lastTarget.Position); if (IsAtTarget(lastTarget.Position, 1)) { SendKey.Send(ConstController.WindowsVirtualKey.K_L); lastTarget = null; } break; default: break; } } else { return; } }
public static bool RotateTowards(WoWPlayer PlayerUnit, Vector2 TargetUnitPos, double RotationThreshhold, bool DisableForward) { double mydiff = Angles.AngleDiff(Angles.Calculateangle(TargetUnitPos, PlayerUnit.Position), PlayerUnit.Rotation); if ((Math.Abs(mydiff) < RotationThreshhold)) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, PlayerUnit.MovingInfo.IsTurningLeft, ref PlayerUnit.MovingInfo.myleft, PlayerUnit.WindowTitle); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, PlayerUnit.MovingInfo.IsTurningRight, ref PlayerUnit.MovingInfo.myright, PlayerUnit.WindowTitle); return(true); } else if (mydiff < 0) { if (DisableForward) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref PlayerUnit.MovingInfo.myforward, PlayerUnit.WindowTitle); } SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_LEFT, !PlayerUnit.MovingInfo.IsTurningLeft, ref PlayerUnit.MovingInfo.myleft, PlayerUnit.WindowTitle); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, PlayerUnit.MovingInfo.IsTurningRight, ref PlayerUnit.MovingInfo.myright, PlayerUnit.WindowTitle); } else if (mydiff > 0) { if (DisableForward) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref PlayerUnit.MovingInfo.myforward, PlayerUnit.WindowTitle); } SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_RIGHT, !PlayerUnit.MovingInfo.IsTurningRight, ref PlayerUnit.MovingInfo.myright, PlayerUnit.WindowTitle); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, PlayerUnit.MovingInfo.IsTurningLeft, ref PlayerUnit.MovingInfo.myleft, PlayerUnit.WindowTitle); } return(false); }
private void Rejuvenate() { Halt(); SendKey.Send(ConstController.WindowsVirtualKey.K_9); if (pet != null && pet.HealthPercent < 0.7 && tick % 50 == 0) { SendKey.Send(ConstController.WindowsVirtualKey.K_8); } }
//protected bool RotateTowards(WoWUnit PlayerUnit, WoWUnit TargetUnit, double RotationThreshhold, bool DisableForward) { // return RotateTowards(PlayerUnit, TargetUnit.Position, RotationThreshhold, DisableForward); //} public static bool WalkingTowards(WoWPlayer PlayerUnit, Vector2 mTargetPosition, double mPositionThreshold) { if (Vector2.Distance(new Vector2(PlayerUnit.Position.X, PlayerUnit.Position.Y), mTargetPosition) < mPositionThreshold) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref PlayerUnit.MovingInfo.myforward, PlayerUnit.WindowTitle); return(true); } else { SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_UP, !PlayerUnit.MovingInfo.IsMovingForward, ref PlayerUnit.MovingInfo.myforward, PlayerUnit.WindowTitle); return(false); } }
public void KillTarget() { if (target != null) { if (castedSpell == 0) { if (target.HealthPercent < 0.3) { SendKey.Send(ConstController.WindowsVirtualKey.K_V); } else { SendKey.Send(ConstController.WindowsVirtualKey.K_1); } } } else { SendKey.Send(ConstController.WindowsVirtualKey.VK_TAB); } }
//protected bool WalkingTowards(WoWUnit mPlayerUnit, WoWUnit mTargetUnit, double mPositionThreshhold) { // return WalkingTowards(mPlayerUnit, mTargetUnit.Position, mPositionThreshhold); //} protected void Halt(WoWPlayer PlayerUnit) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref PlayerUnit.MovingInfo.myforward, PlayerUnit.WindowTitle); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, PlayerUnit.MovingInfo.IsTurningLeft, ref PlayerUnit.MovingInfo.myleft, PlayerUnit.WindowTitle); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, PlayerUnit.MovingInfo.IsTurningRight, ref PlayerUnit.MovingInfo.myright, PlayerUnit.WindowTitle); }