How to keep data, up to date
Hi, I'm working on my first addon. Its a profession tracker, to show where trainers are, herb/ore tracking status, what veins + herbs I can or can't harvest and what skill I need to harvest them, etc etc.
Anyway, as soon as I login to the world, I toggle the addon via slash command and it correctly shows skill levels and tracking status etc, but if I gain skills, or change from herb to ore tracking, it doesn't update. How do I keep the data up to date? I basically want to refresh my addon every second. How would I go about doing this? |
Hi, if you want to execute code every second no matter what, you could do it like this:
Code:
local lastCall = GetTime() Code:
local timePassed = 0 But you know that there are also the game EVENTS, which you can register for, such that your code only gets executed after the respective event? |
Thankyou, exactly what I needed.
|
For timers there is C_Timer: https://wow.gamepedia.com/API_C_Timer
But in this case you should look into events like LudiusMaximus mentioned it. |
All times are GMT -6. The time now is 02:48 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI