Problem getting accurate spell descriptions
Here's another headscratcher I've run into.
I am trying to figure out the amount of healing or damage a spell does. In the past, I used a tooltip scanner, but that approach doesn't seem to work now... or if it does, I don't know how to code it correctly because I can no longer call GetText() on tooltip's font strings and get the actual text back (I get nil instead). So I am trying to use Spell:CreateFromSpellID / ContinueOnSpellLoad / GetSpellDescription, which seems to be the intended way of getting spell descriptions now. So, here's the scenario: * I get the description of a healing spell. It has the correct healing amount. * I get a buff that increases all healing done by 15%. * My UNIT_AURA callback is called and I get the spell description again. It has the old -- incorrect -- healing numbers. * Several hundred milliseconds later, the string returned by GetSpellDescription() finally changes to reflect the correct healing amount. There doesn't seem to be an event associated with this description change. * The buff expires. Several hundred milliseconds later, the text reverts to the original healing amount. Now, the long delay itself isn't a problem. The problem is that I can't find a way to detect the moment of change via an event. Sure, I can poll for changes, but that sucks because it's much less inefficient. So, two questions. 1. Is there a better way to handle this aside from polling? 2. Is tooltip scanning still a thing? (If so, a working code sample would have been awesome) Thanks! |
I can't give you a real answer (because I don't have the knowledge), but I can throw a hint at you:
AceTimer-3.0.lua mentions: Code:
-- AceTimer is currently limited to firing timers at a frequency of 0.01s as this is what the WoW timer API C_Timer.After GetNetStats So, my idea is that, upon UNIT_AURA firing, you'd get the world latency via GetNetStats(), add that value to 0.01 and set a one time timer, via C_Timer.After(), to execute your GetSpellDescription() routine. I haven't tested this, but I think it should work fairly well. Do note that the game itself updates the recorded latency only once every 30 secons, so there might be some times where the above method fails because of instant latency higher than the last recorded value. Adding some extra padding time might be a good idea. |
Quote:
|
This seems to scan just fine
Lua Code:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
Quote:
|
Quote:
And the OP (who was also who posted the comment I was inquiring about) just confirmed after your post that they're alright with listening to that event. But indeed, Kanegasi, your point was valid (to me) and I actually had given no consideration to it before, so... :cool: Quote:
So, for example, your assumption that my untested code would be worse than polling for changes is actually baseless. Even so, it might, upon testing, prove to be true. Or not. I asked because you seemed certain of what you were saying and I wanted to learn. Turns out you're no more certain about what you said than I was about what I proposed. Just sayin'. |
All times are GMT -6. The time now is 05:40 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI