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

How do I check the hpp value?

Status
Not open for further replies.

JoeBobJr

Member
Joined
Oct 25, 2014
Messages
151
Reaction score
1
if I want to see if my hp is at a certain percent do I just check it with something like this? It doesn't seem to be working correctly

Code:
    if (hpp(me) < 65 && (skillCooldown("Redoubt") == 0))
    //Casting "Redoubt"
    {
         UseSkill("Redoubt", true);
         Log("Used: Redoubt");
    }

Is the percent go from 1-100 or is the value different?
 
It is a percent. I would change it to:

Code:
if (hpp(me) <= 65 && skillCooldown("Redbout") == 0)
                    {     
                        UseSkillAndWait("Redoubt", true);
                        Thread.Sleep(50);
                     }
 
Xseek, don't suggest people to change things when you have no idea what you are talking about. All you did was make his formating worse. UseSkillAndWait() is a function that someone authored, not one that is native to the AB API. UseSkill() is the correct, native function. You are correct that having a sleep interval is important. In either case, you wouldn't want to use UseSkillAndWait() because it has extra if statements that will slow down the script marginally because it checks LoS: when you are doing self-heals, there's no need to check LoS.

OP:

As Xseek says and you already knew, hpp() is checking HP value as a percentage. In your console, do you see the log that you want it to write? If so, could be a problem with global CD management or with high latency. Try:

Code:
if (hpp() <= 65 && (skillCooldown("Redoubt") == 0))
{
    while (me.isGlobalCooldown || me.isCasting)
        Thread.Sleep(25);
    UseSkill("Redoubt", true);
    while (me.isGlobalCooldown) // We can use the second loop to make sure that we aren't on global CD when we try and cast our next spell.
    	Thread.Sleep(25);    
}

EDIT: If you are trying to heal yourself mid-fight, I don't know off-hand how self-targeting works. You may need to write a function which stores your existing target, so that you can switch to yourself, and then switch back to the original after healing has taken place.
 
Last edited:
Why bother checking to isGlobalCooldown || me.isCasting? 50 is the GCD time, so assuming the rest of the script is written using 50 instead of 25 in every function, it will hit this portion of code after a Thread.Sleep(50); and be off GCD. Just wondering.

Wouldn't this suffice?

Code:
[COLOR=#333333]if (hpp(me) <= 65 && (skillCooldown("Redoubt") == 0)
{
UseSkill("Redoubt",true);
Log("Used: Redoubt");
Thread.Sleep(50);
}
[/COLOR]
 
A few thoughts on this matter:

1. 50ms != GCD. If that were the case, you could cast 20 skills per second.
2. Relying on time intervals is much less reliable than just checking to see if we are casting or are in global cooldown state.

Here are two low hanging fruit examples:
- GCD is reduced by CDR. If we rely on interval, if you have CDR, you are losing efficiency.
- Latency is variable. If we rely on time interval, change in latency could cause us to cast while still on CD. Unless you have something to validate that the skill has been casted (check to see if UseSkill() return true, and while UseSkill() returns false keep on using UseSkill()--this method is usually not as good as checking GCD because there are many reasons that we could not be casting, and we don't want to get stuck in that loop).
 
A few thoughts on this matter:

1. 50ms != GCD. If that were the case, you could cast 20 skills per second.
2. Relying on time intervals is much less reliable than just checking to see if we are casting or are in global cooldown state.

Here are two low hanging fruit examples:
- GCD is reduced by CDR. If we rely on interval, if you have CDR, you are losing efficiency.
- Latency is variable. If we rely on time interval, change in latency could cause us to cast while still on CD. Unless you have something to validate that the skill has been casted (check to see if UseSkill() return true, and while UseSkill() returns false keep on using UseSkill()--this method is usually not as good as checking GCD because there are many reasons that we could not be casting, and we don't want to get stuck in that loop).


Thank you for the advice will check into that.
 
Status
Not open for further replies.
Back
Top