tried to do the above by adding this to the flask identifier part of the exile.cs
note the exact name of the flask I have equipped. i wonder if there is a better way to do this. and then, also in the flask logic, added this:
Of course the conditions to use the diamondflask can be changed to your liking.
Is there a better way to identify diamond flasks? If so this could go into default exile.cs for future support, otherwise this should help you if you need this logic in your bot right now.
private IEnumerable<InventoryItem> DiamondFlasks
{
get
{
IEnumerable<InventoryItem> inv = LokiPoe.ObjectManager.Me.Inventory.Flasks.Items;
return from item in inv
let flask = item.Flask
where flask != null && item.FullName == "Perpetual Diamond Flask of Reflexes" &&
flask.CanUse
select item;
}
}
{
get
{
IEnumerable<InventoryItem> inv = LokiPoe.ObjectManager.Me.Inventory.Flasks.Items;
return from item in inv
let flask = item.Flask
where flask != null && item.FullName == "Perpetual Diamond Flask of Reflexes" &&
flask.CanUse
select item;
}
}
note the exact name of the flask I have equipped. i wonder if there is a better way to do this. and then, also in the flask logic, added this:
new Decorator(ret => _flaskCd.IsFinished && DiamondFlasks.Count() != 0 && (BestTarget.Rarity >= Rarity.Rare || NumberOfMobsNear(BestTarget, 120, 8)),
new Action(ret =>
{
DiamondFlasks.First().Use();
_flaskCd.Reset();
})),
new Action(ret =>
{
DiamondFlasks.First().Use();
_flaskCd.Reset();
})),
Of course the conditions to use the diamondflask can be changed to your liking.
Is there a better way to identify diamond flasks? If so this could go into default exile.cs for future support, otherwise this should help you if you need this logic in your bot right now.