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; } }
private void SearchForTarget() { if (target == null) { SendKey.Send(ConstController.WindowsVirtualKey.VK_TAB); } }
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); } }
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); } }