internal static async Task PullItemsByID(List <uint> ids) { //var itemIds = ids.Select(x => x.Item).ToList(); // SelectMany(x => x.Id); Logger.Info($"Checking against {ids.Count()}"); var retItems = InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).Select(i => i.FilledSlots).SelectMany(x => x).Where(i => i.IsHighQuality && ids.Contains(i.RawItemId)).AsParallel(); foreach (var slot in retItems) { RetainerRoutine.LogLoud($"Want to move {slot} - {slot.Count}"); slot.RetainerRetrieveQuantity((int)slot.Count); await Coroutine.Sleep(200); } }
internal static async Task PullItems(List <uint> ids) { //var itemIds = ids.Select(x => x.Item).ToList(); // SelectMany(x => x.Id); Logger.Info($"Checking against {ids.Count()}"); var retItems = InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).Select(i => i.FilledSlots).SelectMany(x => x).AsParallel().Where(i => i.Count < 99 && i.Item.ItemLevel < 300 && i.Item.StackSize == 999).Where(k => k.Item.EngName.Contains("Ore") || k.Item.EngName.Contains("Log")).Where(j => GatheringCategories.Contains(j.Item.EquipmentCatagory) && !ids.Contains(j.RawItemId)); foreach (var slot in retItems) { RetainerRoutine.LogLoud($"Want to move {slot} - {slot.Count}"); //slot.RetainerRetrieveQuantity((int) Math.Min(ids.First(i => i.Item == slot.RawItemId).Amount, slot.Count)); await Coroutine.Sleep(200); } }
internal static async Task PullItems(List <LisbethOrder> ids) { var itemIds = ids.Select(x => x.Item).ToList(); // SelectMany(x => x.Id); Logger.Info($"Checking against {itemIds.Count()}"); var retItems = InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).Select(i => i.FilledSlots).SelectMany(x => x).Where(i => itemIds.Contains((int)i.RawItemId)); foreach (var slot in retItems) { RetainerRoutine.LogLoud($"Want to move {slot}"); slot.RetainerRetrieveQuantity((int)Math.Min(ids.First(i => i.Item == slot.RawItemId).Amount, slot.Count)); await Coroutine.Sleep(200); } }
public async Task LowerItemsById() { await RetainerRoutine.ReadRetainers(PullListItems); await Coroutine.Sleep(1000); foreach (var slot in InventoryManager.FilledSlots.Where(i => i.IsHighQuality && ItemsToLower.Contains(i.RawItemId))) { RetainerRoutine.LogLoud($"Lowering {slot}"); slot.LowerQuality(); await Coroutine.Sleep(1000); } await Coroutine.Sleep(1000); await RetainerRoutine.ReadRetainers(RetainerRoutine.DumpItems); }
internal static async Task PullItemsByCategories(ItemUiCategory[] categories) { foreach (var cat in categories) { RetainerRoutine.LogLoud($"Category {cat}"); var retItems = InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).Select(i => i.FilledSlots).SelectMany(x => x).Where(i => i.Item.EquipmentCatagory == cat && i.Item.MyItemRole() != MyItemRole.Map); RetainerRoutine.LogLoud($"Category {retItems.Count()}"); foreach (var slot in retItems) { RetainerRoutine.LogLoud($"Want to move PULL {slot} - {slot.Count}"); slot.RetainerRetrieveQuantity((int)slot.Count); await Coroutine.Sleep(700); } await Coroutine.Sleep(200); } }
internal static async Task DumpItemsByCategories(ItemUiCategory[] categories) { var myItems = InventoryManager.FilledSlots.Where(i => categories.Contains(i.Item.EquipmentCatagory) && i.Item.MyItemRole() != MyItemRole.Map); foreach (var slot in myItems) { if (InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).FirstOrDefault(i => i.FreeSlots > 1) != null) { RetainerRoutine.LogLoud($"Want to move DUMP {slot} - {slot.Count}"); slot.Move(InventoryManager.GetBagsByInventoryBagId(RetainerBagIds).First(i => i.FreeSlots > 1).GetFirstFreeSlot()); //slot.RetainerEntrustQuantity((int) slot.Count); await Coroutine.Sleep(700); } else { RetainerRoutine.LogLoud($"Not Enough room in retainer"); } } await RetainerRoutine.DumpItems(); }