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

Divination Distilate

Oli31

New Member
Joined
Oct 4, 2012
Messages
9
Reaction score
0
So I've tried everything to get the bot to take the flask under the right circumstances and it just wont use it.

The only way I've managed to get it to use it is if I fool the bot into thinking it's a mana flask, but then it will only use it when im out of mana obviously.

Can someone help me with my exile.cs?

Code:
private IEnumerable<InventoryItem> DivinationDistillate
        {
            get
            {
                IEnumerable<InventoryItem> inv = LokiPoe.PlayerInventory.Flasks.Items;
                return from item in inv
                       let flask = item.Flask
                       where flask != null && item.FullName == "Divination Distillate" && flask.CanUse
                       select item;
            }
        }

        private bool ShouldUseDivinationDistillate()
        {
            var target = BestTarget;

            // Make sure we have a target!
            if (target == null)
                return false;

            // Never use on a non-unique.
            if (target.Rarity != Rarity.Unique)
                return true;

            // If it has more than 8% health, don't use the flask.
            if (target.HealthPercent > 8)
                return false;

            // If we get here, use the flask.
            return true;
        }

        private Composite CreateFlaskLogic()
        {
            return new PrioritySelector(

                // This logic should use a Divination Distillate when needed.
                /*new Decorator(ret => _flaskCd.IsFinished && !Me.HasAura("unique_flask_divination_distillate") && DivinationDistillate.Count() != 0 && ShouldUseDivinationDistillate(),
                    new Action(ret =>
                    {
                        DivinationDistillate.First().Use();
                        _flaskCd.Reset();
                    })),*/

Many thanks.

Edit: Also, if I get this fixed, is there a simple way I can tell the bot to use the flask on rare mobs as well as uniques?
 
Last edited:
So I've tried everything to get the bot to take the flask under the right circumstances and it just wont use it.

The only way I've managed to get it to use it is if I fool the bot into thinking it's a mana flask, but then it will only use it when im out of mana obviously.

Can someone help me with my exile.cs?

Code:
private IEnumerable<InventoryItem> DivinationDistillate
        {
            get
            {
                IEnumerable<InventoryItem> inv = LokiPoe.PlayerInventory.Flasks.Items;
                return from item in inv
                       let flask = item.Flask
                       where flask != null && item.FullName == "Divination Distillate" && flask.CanUse
                       select item;
            }
        }

        private bool ShouldUseDivinationDistillate()
        {
            var target = BestTarget;

            // Make sure we have a target!
            if (target == null)
                return false;

            // Never use on a non-unique.
            if (target.Rarity != Rarity.Unique)
                return true;

            // If it has more than 8% health, don't use the flask.
            if (target.HealthPercent > 8)
                return false;

            // If we get here, use the flask.
            return true;
        }

        private Composite CreateFlaskLogic()
        {
            return new PrioritySelector(

                // This logic should use a Divination Distillate when needed.
                /*new Decorator(ret => _flaskCd.IsFinished && !Me.HasAura("unique_flask_divination_distillate") && DivinationDistillate.Count() != 0 && ShouldUseDivinationDistillate(),
                    new Action(ret =>
                    {
                        DivinationDistillate.First().Use();
                        _flaskCd.Reset();
                    })),*/

Many thanks.

Edit: Also, if I get this fixed, is there a simple way I can tell the bot to use the flask on rare mobs as well as uniques?

Edit this line :

if (target.Rarity != Rarity.Unique)

to

if (target.Rarity < Rarity.Rare)

EDIT :

// Never use on a non-unique.
if (target.Rarity != Rarity.Unique)
return true;

this seems a bit clunky... the bot will only use it vs Non-unique mobs, which is absolutely not the purpose. It should return false.

private bool ShouldUseDivinationDistillate()
{
var target = BestTarget;

// Reqs :
// 1) Target is not null
// 2) Rarity Rare or higher
// 3) Health Percentage < 8

return (target != null && target.Rarity >= Rarity.Rare && target.HealthPercent < 8);
}

Should do the trick ;)
 
Last edited:
Edit this line :



to



EDIT :



this seems a bit clunky... the bot will only use it vs Non-unique mobs, which is absolutely not the purpose. It should return false.



Should do the trick ;)

i dont see what I'm supposed to change to get it working from your reply.

I understand the rarity bit, thought that may be the thing to do anyway, just didn't know if it was that simple and if it would still use it on uniques and not just rare mobs.
 
i dont see what I'm supposed to change to get it working from your reply.

I understand the rarity bit, thought that may be the thing to do anyway, just didn't know if it was that simple and if it would still use it on uniques and not just rare mobs.

This code :

private bool ShouldUseDivinationDistillate()
{
var target = BestTarget;

// Reqs :
// 1) Target is not null
// 2) Rarity Rare or higher
// 3) Health Percentage < 8

return (target != null && target.Rarity >= Rarity.Rare && target.HealthPercent < 8);
}

Will use your flask on a Valid Rare target or higher (so rare & unique) if this one have less than 8% hp to make sure the flask aura is still on when you kill it ;)

Just replace your actual ShouldUseDivinationDistillate() method by this one, should work as intented
 
By default, you just need to uncomment the code section for that flask in Exile to get the bot to use it under the current conditions.

That is:
Code:
// This logic should use a Divination Distillate when needed.
                /*new Decorator(ret => _flaskCd.IsFinished && !Me.HasAura("unique_flask_divination_distillate") && DivinationDistillate.Count() != 0 && ShouldUseDivinationDistillate(),
                    new Action(ret =>
                    {
                        DivinationDistillate.First().Use();
                        _flaskCd.Reset();
                    })),*/

should become

Code:
// This logic should use a Divination Distillate when needed.
                   new Decorator(ret => _flaskCd.IsFinished && !Me.HasAura("unique_flask_divination_distillate") && DivinationDistillate.Count() != 0 && ShouldUseDivinationDistillate(),
                    new Action(ret =>
                    {
                        DivinationDistillate.First().Use();
                        _flaskCd.Reset();
                    })),

Then, you can change the conditions in ShouldUseDivinationDistillate as needed. However, as toNyx pointed out, your modifications don't make sense current.

If you only want it to be used on Uniques, then you leave the code as is from the default CR. If you want to use it on rares and uniques, you'd use :
Code:
// Never use on a non-unique/non-rare.
            if (target.Rarity != Rarity.Unique && target.Rarity != Rarity.Rare)
                return false;

Basically, the function logic is setup in a way to basically return "do not use" if the conditions are not being met, so by the time you get to the end, you know you should be using it. You can implement the checks different ways if you want, but what's there now was just the most simple way with comments to show the process.
 
Back
Top