kagamihiiragi17
Community Developer
- Joined
- Jun 24, 2014
- Messages
- 873
How to use items/access inventory
Is there a good way to use items in RebornBuddy? Ideally I'd like to modify the combat routines to apply a food buff if you won't have one and to pop potions if you fall below ~10% HP/MP, depending on the class. I've tried some things in the Reborn Console, but I can't tell how well my code works in there. Thanks!
EDIT: I figured it out, I trying to use Managers.Bag.Slots instead of Managers.InventoryManager.Slots, which wasn't working. Oops!
If anyone else has problems accessing the inventory or using items, here is some example code as rudimentary documentation:
Is there a good way to use items in RebornBuddy? Ideally I'd like to modify the combat routines to apply a food buff if you won't have one and to pop potions if you fall below ~10% HP/MP, depending on the class. I've tried some things in the Reborn Console, but I can't tell how well my code works in there. Thanks!
EDIT: I figured it out, I trying to use Managers.Bag.Slots instead of Managers.InventoryManager.Slots, which wasn't working. Oops!
If anyone else has problems accessing the inventory or using items, here is some example code as rudimentary documentation:
Code:
string foodname = "Marmot Steak";
foreach (BagSlot a in InventoryManager.Slots)
{
if (a.Name == foodname)
{
a.UseItem();
}
}
Last edited: