I can't get Bagslot.UseItem() to work on high quality potions. Am I doing something wrong or is this a bug? [h=3][/h]
Code: var pot = InventoryManager.FilledSlots.FirstOrDefault(a => a.Name.Equals("Mega-Potion Of Dexterity")); if (pot != null && pot.IsValid) { Logging.Write("[RebornCo] Found: " + pot.Name); pot.UseItem(); }
Code: [23:34:30.850 D] DoAction Item 4595 0xE0000000 If you wan't it to use HQ items you need to filter out non-hq otherwise your code is just going to use whatever item it finds first.
that was when i swtiched to a Potion Of Dexterity instead of the hq Mega-Potion Of Dexterity I had in my inventory, to check if the code should be using an item. Code: [23:34:10.577 N] [RebornCo] Found: Mega-Potion of Dexterity [23:34:30.833 N] [RebornCo] Found: Potion of Dexterity [23:34:30.850 D] DoAction Item 4595 0xE0000000 I would be fine with it using either quality but it's not using hq at all. Were your test results different?
Also if your going to be bad and use strings then make sure to compare both the englishname and the currentlocalename of objects so that it will work in other regions.