public async Task <bool> Loot(bool searchForMobs) { input.SetCursorPosition(new Point(this.lastLootFoundAt.X + 200, this.lastLootFoundAt.Y + 120)); await Task.Delay(150); //if (!searchForMobs) //{ // WowProcess.SetCursorPosition(this.lastLootFoundAt); // await Task.Delay(200); //} if (await CheckForLoot(this.lastLootFoundAt, searchForMobs, false)) { logger.LogInformation($"Loot at {this.lastLootFoundAt.X},{this.lastLootFoundAt.Y}"); return(true); } else { logger.LogInformation($"No loot at {this.lastLootFoundAt.X},{this.lastLootFoundAt.Y}"); } if (!searchForMobs) { if (await SearchInCircle(radiusLarge / 2, radiusLarge / 2, false, centre, false)) { return(true); } } if (await SearchInCircle(radiusLarge, radiusLarge, searchForMobs, centre, false)) { return(true); } if (searchForMobs && lastLootFoundAt.X != 0) { await CheckForLoot(lastLootFoundAt, false, true); } return(false); }
public async Task Execute() { wowProcessInput.SetForegroundWindow(); wowProcessInput.SetCursorPosition(new Point(25, 25)); await Task.Delay(500); wowProcessInput.SetCursorPosition(new Point(50, 50)); await Task.Delay(500); await Task.Delay(500); var p = new Point(120, 120); await wowProcessInput.LeftClickMouse(p); await Task.Delay(500); await wowProcessInput.RightClickMouse(p); await Task.Delay(500); await wowProcessInput.RightClickMouse(p); wowScreen.GetRectangle(out var rect); p = new Point(rect.Width / 3, rect.Height / 5); await Task.Delay(500); await wowProcessInput.RightClickMouse(p); await Task.Delay(500); await wowProcessInput.RightClickMouse(p); logger.LogInformation("Finished"); }