private void Hook_KeyPressed(object sender, KeyPressedEventArgs e) { if (e.Modifier == ModifierKeys.None && e.Key == Keys.ControlKey) { if (chkEditMode.IsChecked == false) { Log.Write("You are not in edit mode, if you wish to record a new routine ensure to tick the edit mode checkbox.", Brushes.Red); return; } POINT point; Mouse.GetCursorPos(out point); Pixels.ScreenToClient(Globals.Process.MainWindowHandle, ref point); var color = Pixels.GetPixelColor(point); combatRoutine.Pause(); Log.Write($"RGB = {color.R},{color.G},{color.B}", Brushes.WhiteSmoke); wpfSpell f = new wpfSpell(color, point, combatRoutine); f.WindowStartupLocation = WindowStartupLocation.CenterScreen; f.Topmost = true; f.ShowDialog(); if (combatRoutine.Spells.Count > 0) { combatRoutine.Start(); } } if (e.Modifier == ModifierKeys.Alt && e.Key == Keys.X) { cmdStartStop_Click(null, null); } if (e.Modifier == ModifierKeys.Alt && e.Key == Keys.S) { if (combatRoutine.Type == CombatRoutine.RotationType.SingleTarget) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); return; } if (combatRoutine.Type == CombatRoutine.RotationType.AOE) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); return; } } }
private void Hook_KeyPressed(object sender, KeyPressedEventArgs e) { lblHotkeyInfo.Text = e.Modifier + " + " + e.Key; if (e.Modifier == Helpers.ModifierKeys.Ctrl && e.Key == Keys.F5) { cmdReloadRotationAndUI.PerformClick(); } if (e.Modifier == Helpers.ModifierKeys.Ctrl && e.Key == Keys.F6) { cmdReloadRotation.PerformClick(); } if (ConfigFile.ReadValue("Hotkeys", "cmbStartRotationKey") != "") { if (e.Modifier == Keyboard.StartRotationModifierKey && e.Key == Keyboard.StartRotationKey) { cmdStartBot_Click(null, null); return; } if (e.Modifier == Keyboard.StopRotationModifierKey && e.Key == Keyboard.StopRotationKey) { cmdStartBot_Click(null, null); return; } if (combatRoutine == null) { return; } if (Keyboard.SingleTargetModifierKey == Keyboard.AOEModifierKey && Keyboard.SingleTargetKey == Keyboard.AOEKey) { if (e.Modifier == Keyboard.SingleTargetModifierKey && e.Key == Keyboard.SingleTargetKey) // or AOEKey - since they the same in this case { if (combatRoutine.Type == CombatRoutine.RotationType.SingleTarget) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); return; } if (combatRoutine.Type == CombatRoutine.RotationType.AOE) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTargetCleave); return; } combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); } } else { if (e.Modifier == Keyboard.SingleTargetModifierKey && e.Key == Keyboard.SingleTargetKey) { if (combatRoutine.Type != CombatRoutine.RotationType.SingleTarget) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); return; } } if (e.Modifier == Keyboard.AOEModifierKey && e.Key == Keyboard.AOEKey) { if (combatRoutine.Type != CombatRoutine.RotationType.AOE) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); } else { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTargetCleave); } } } } else // If defaults are not setup, then use these as defaults { if (e.Modifier == Helpers.ModifierKeys.Ctrl) { if (e.Key == Keys.S) { cmdStartBot_Click(null, null); } } if (e.Modifier == Helpers.ModifierKeys.Alt) { if (e.Key == Keys.S) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); } if (e.Key == Keys.A) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); } if (e.Key == Keys.C) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTargetCleave); } } } }
private void Hook_KeyPressed(object sender, KeyPressedEventArgs e) { lblHotkeyInfo.Text = e.Modifier + " + " + e.Key; if (ConfigFile.ReadValue("Hotkeys", "cmbStartRotationKey") != "") { if (e.Modifier == Keyboard.StartRotationModifierKey && e.Key == Keyboard.StartRotationKey) { cmdStartBot_Click(null, null); return; } if (e.Modifier == Keyboard.StopRotationModifierKey && e.Key == Keyboard.StopRotationKey) { cmdStartBot_Click(null, null); return; } if (combatRoutine == null) { return; } if (e.Modifier == Keyboard.SingleTargetModifierKey && e.Key == Keyboard.SingleTargetKey) { if (combatRoutine.Type != CombatRoutine.RotationType.SingleTarget) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); return; } } if (e.Modifier == Keyboard.AOEModifierKey && e.Key == Keyboard.AOEKey) { if (combatRoutine.Type != CombatRoutine.RotationType.AOE) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); } } } else { if (e.Modifier == Helpers.ModifierKeys.Ctrl) { if (e.Key == Keys.S) { cmdStartBot_Click(null, null); } } if (e.Modifier == Helpers.ModifierKeys.Alt) { if (e.Key == Keys.S) { combatRoutine.ChangeType(CombatRoutine.RotationType.SingleTarget); } if (e.Key == Keys.A) { combatRoutine.ChangeType(CombatRoutine.RotationType.AOE); } } } }