What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Bagslot.UseItem() hq items

kaihaider

Community Developer
Joined
May 18, 2010
Messages
1,325
Reaction score
5
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]
 
Log and example of your code.

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();
    }
 

Attachments

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?
 
Thanks got it, pushing a new build now.
 
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.
 
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.
if the names are user settings and not hard coded, would a .Name be fine?
 
Back
Top