public void Do() { if (_bobberLocation != Point.Empty) { return; } for (var y = 200; y <= 700; y += 30) { for (var x = 800; x <= 1000; x += 20) { var mouseOverUnitGuid = GetPositionMouseOverUnit(new Point(x, y)); var itemFound = ObjectManager.Objects.FirstOrDefault(obj => obj.Guid == mouseOverUnitGuid); var gameObject = itemFound as WowGameObject; if (gameObject != null) { _bobberLocation = new Point(x, y); while (!Task.Delay(Timings.ThirtySeconds).IsCompleted) { if (gameObject.Bobbing == 1) { KeyboardCommandDispatcher.GetKeyboard().SendShiftClick(_bobberLocation); Task.Delay(500).Wait(); _bobberLocation = Point.Empty; return; } } } } } }
public void Do() { KeyboardCommandDispatcher.GetKeyboard().SendCtrlKey(MappedKeys.PetBar1.Key); while (ObjectManager.Me.Target?.Target != ObjectManager.Me.Pet) { Task.Delay(200).Wait(); if (ObjectManager.Me.Target == null) { return; } if (ObjectManager.Me.Pet == null) { return; } if (ObjectManager.Me.Pet.Target == null) { return; } if (ObjectManager.Me.Pet.Target != ObjectManager.Me.Target) { CommandManager.GetDefault().SetTarget(ObjectManager.Me.Pet.Target); return; } } }
private ulong GetPositionMouseOverUnit(Point point) { var offsetPoint = KeyboardCommandDispatcher.GetKeyboard().GetOffsetPoint(point); Cursor.Position = offsetPoint; Task.Delay(5).Wait(); return(CommandManager.GetDefault().MouseOverUnit); }
public void AttachThreadsAndSetState() { var process = Process.GetProcessesByName("Notepad").First(); var kcd = new KeyboardCommandDispatcher(process); //kcd.SendKeys("!!!"); kcd.SendKeys("Hello World!"); kcd.SendKeys("!\"£$%^&*()_+"); }
public bool Start(HostControl hostControl) { var processMemoryReader = new ProcessMemoryReader(_process); var keyboard = KeyboardCommandDispatcher.GetKeyboard(_process); var commandManager = CommandManager.GetDefault(_process, processMemoryReader, keyboard, _logger); _robotManager = new RobotManager(commandManager, _logger); _robotManager.Start(); return(true); }