Ovale Spell Priority

Ovale Spell Priority

6M Downloads

[9.0.21] SpellCooldown() function do not work correctly

sirTribble opened this issue ยท 8 comments

commented

Sample script for holy pal


Define(holy_shock 20473)
SpellInfo(holy_shock cd=7.5 holypower=-1)
Define(crusader_strike 35395)

AddIcon
{
if SpellCooldown(holy_shock) > 0 spell(crusader_strike)
}

commented

Is it a bug or not?

commented

there is something wrong with spellcooldown()

commented

Ok!

commented

its a bug. spend some time testing it. updated sample script for more convenient results

commented

For what it's worth, I've been able to reproduce this bug, although I don't have a small script example to reproduce the problem. I was using a fairly long custom script and saw the cooldown issue, so I generated a trace log (see attached).
trace.log

commented

The first and last lines are:

Reset state with current time = 494255.368000
    nextCast = 494255.368000
...
GetAction: start=494290.073, id=311648

You can see that the time of the next cast (494255.368000) is less than the action start time (494290.073) by about 35 seconds. However the script was definitely suggesting to cast Swarming Mist (id=311648) right away, even though it was on cooldown for another 35 seconds.

commented

I don't think it's a bug in any of the engine code, but rather something in src/ui/Frame.ts that takes the correct timespan for the best action and is somehow messing up with that information. I'm still getting used to reading TypeScript, so I haven't tracked down exactly where it's going wrong.

commented

I don't reproduce this bug. As soon as I cast Holy Shock, I see Crusader Strike