public static CommandManager GetDefault(IWowProcess process = null, IProcessMemoryReader reader = null, KeyboardCommandDispatcher keyboard = null, ILogger logger = null) { if (_commandManager != null) { return(_commandManager); } if (process == null) { throw new ArgumentNullException(nameof(process)); } if (reader == null) { throw new ArgumentNullException(nameof(reader)); } if (keyboard == null) { throw new ArgumentNullException(nameof(keyboard)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } _commandManager = new CommandManager(process, reader, keyboard, logger); return(_commandManager); }
private CommandManager(IWowProcess process, IProcessMemoryReader reader, KeyboardCommandDispatcher keyboard, ILogger logger) { _process = process; _reader = reader; _keyboard = keyboard; _logger = logger; }
private WowUnit GetPositionMouseOverUnit(Point point) { var offsetPoint = KeyboardCommandDispatcher.GetKeyboard().GetOffsetPoint(point); Cursor.Position = offsetPoint; Task.Delay(10).Wait(); var mouseOverUnit = CommandManager.GetDefault().MouseOverUnit; return ObjectManager.Units.FirstOrDefault(u => u.Guid == mouseOverUnit); }
public static KeyboardCommandDispatcher GetKeyboard(IWowProcess process = null) { if (_instance != null) { return(_instance); } if (process == null) { throw new ArgumentNullException(nameof(process), "Keyboard not initialised. Process must be provided"); } _instance = new KeyboardCommandDispatcher(process.MainWindowHandle); return(_instance); }
private void InternalSkin(Point point) { _logger.Information($"Attempting to skin unit"); KeyboardCommandDispatcher.GetKeyboard().SendShiftClick(point); Task.Delay(2400).Wait(); }