public async Task MoveItemsAroundMain() { //await RetainerRoutine.ReadRetainers(DumpItemsByCategoryMain); //await Coroutine.Sleep(1000); await RetainerRoutine.ReadRetainers(PullItemsByCategoryMain); await Coroutine.Sleep(1000); await RetainerRoutine.ReadRetainers(DumpItemsByCategoryMain); }
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(); }
public async Task GenerateList() { foreach (var category in CountCategories) { categoryCount.Add(category, new List <ItemStored>()); } await RetainerRoutine.ReadRetainers(CountCategoryItems); foreach (var category in CountCategories) { using (var outputFile = new StreamWriter($"{category.ToString()}.csv", false)) { outputFile.WriteLine($"ItemId,IsHq,Count,Ilvl,ItemUICategory,Name"); foreach (var itemStored in categoryCount[category]) { outputFile.WriteLine($"{itemStored}"); } } } }
public async Task Pullorder() { foreach (var item in orderList) { Logger.Info($"{DataManager.GetItem((uint) item.Item)}"); } await RetainerRoutine.ReadRetainers(CheckForItems); foreach (var item in orderList.ToList()) { var itemCount = DataManager.GetItem((uint)item.Item).ItemCount(); if (itemCount > 0) { if (itemCount >= item.Amount) { Logger.Info($"Removing {item}"); orderList.Remove(item); } else { Logger.Info($"Changing amount of {item} to {item.Amount - (int) itemCount}"); orderList.First(i => i.Item == item.Item).Amount = item.Amount - (int)itemCount; } } else { Logger.Info($"Have no {item}"); } } using (var outputFile = new StreamWriter("Order.json", false)) { outputFile.Write(JsonConvert.SerializeObject(orderList, Formatting.None)); } }
public async Task PullExcludeId() { await RetainerRoutine.ReadRetainers(CheckForItemsById); }