Beispiel #1
0
        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);
        }
Beispiel #2
0
 private CommandManager(IWowProcess process, IProcessMemoryReader reader, KeyboardCommandDispatcher keyboard,
                        ILogger logger)
 {
     _process  = process;
     _reader   = reader;
     _keyboard = keyboard;
     _logger   = logger;
 }
Beispiel #3
0
        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);
        }
Beispiel #5
0
 private void InternalSkin(Point point)
 {
     _logger.Information($"Attempting to skin unit");
     KeyboardCommandDispatcher.GetKeyboard().SendShiftClick(point);
     Task.Delay(2400).Wait();
 }