GetPowerRegen() * (start + duration - GetTime()) rounding problem
Hi,
this code should display the Jab symbol every time the player has enough energy to use Jab and still be able to use Keg Smash when it comes of cooldown. Code:
local regen = GetPowerRegen() |
Have you tried using this? http://wowprogramming.com/docs/api/IsUsableAction
|
As far if I understand it, "IsUsableAction" would only return 0, 1 when "Keg Smash" is on Cooldown but the player has enough energy to use it.
The function of the addon is to predict how much energy the player will have when "Keg Smash" comes off cooldown and, if the predicted value is above 80, inform the player that he can use "Jab" (which costs 40 energy) and still have 40 energy left the moment "Keg Smash" comes off cooldown (so the player can use "Keg Smash" immediately when it comes off cooldown without waiting. |
You could always ceil or floor the result before you compare against it.
|
All times are GMT -6. The time now is 03:52 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI