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

Diamond Flask support

poe3210

New Member
Joined
Mar 25, 2014
Messages
17
Reaction score
0
tried to do the above by adding this to the flask identifier part of the exile.cs

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

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

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.
 
Yeap! Just use Name instead:

Code:
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.Name == "Diamond Flask" && flask.CanUse
                       select item;
            }
        }

The Exile CR contains the flask logic you can reference. In the future, the flask stuff is going to be moved out of CRs into the bot, so you'll be able to just do things like: Utility.DiamondFlasks instead.

Also, before using the flask, you want to make sure the player doesn't have the buff "flask_utility_critical_strike_chance" on, since you don't want the flask to be used in the middle of another one. Just check over the current CreateFlaskLogic for an example with other flasks.

For a list of buffs to check, see the BuffDefiinitions for 1.1.2.
 
Back
Top