Go to Page... |
Thread Tools | Display Modes |
09-23-14, 08:28 AM | #1 | ||
Issue with Cooldownannounce-Script
Hey @all!
I use for DuffedUI v8 the following script to announce cooldowns like Icebound Fortitude, Shield Wall and so on. Announcescript: Lua Code:
Delayfunction: Lua Code:
The problem is that when I log in and use a skill that is in the table, nothing happens. Do I have a reload of the entire interface made, the script works and I get the desired output, such as
Currently, I honestly do not and how I could fix the problem.Thank you once for all proposals or suggestions to the problem. greetz liquid |
|||
09-23-14, 08:44 AM | #2 |
Just a quick guess: does using PLAYER_LOGIN instead of PLAYER_ENTERING_WORLD fix your problem?
Don't ask me on details (can't remember exactly ), but the events on reloading the UI are not 100% the same as on login. [e] Doh. Nevermind. I'm just realizing that you're registering PLAYER_ENTERING_WORLD but don't actually use it. Last edited by Duugu : 09-23-14 at 08:48 AM. |
|
09-23-14, 08:54 AM | #3 |
I would say this is about
Lua Code:
C["duffed"].spellannounce is there on reload but not on login. Move this into the OnEvent function and trigger it on PLAYER_ENTERING_WORLD: Lua Code:
Do the same with this part: Lua Code:
|
|
09-23-14, 09:06 AM | #4 |
D.Delay is a global function for the entire UI so I in which the option can not connect with. I use it for different elements. And when I put the query together with Spell-Table in the OnEvent function, I got the same result.
After logging => no function After the reload => Works |
|
09-23-14, 09:44 AM | #5 |
Lua Code:
I don't know why it does work after reloading the UI (would say it shouldn't ) ... but this could be a hint to your problem. Last edited by Duugu : 09-23-14 at 09:48 AM. |
|
09-23-14, 09:53 AM | #6 |
After moving these two values into the OnEvent-function it works. I had replace GUID and Name in the function with UnitGUID("player") and UnitName("player") and it works. Code looks now posted below and ist works.
Lua Code:
Thanks Duugu, you have point me in the correct direction with your help |
|
09-23-14, 09:56 AM | #7 |
Yeah, name and/or GUID not being available seems probable. Much data gets downloaded as you login and might not need to be downloaded again when you reload the UI.
Another way to check if the unit is the player is this: Code:
CombatLog_Object_IsA(flags, COMBATLOG_FILTER_ME)
__________________
Grab your sword and fight the Horde! Last edited by Lombra : 09-23-14 at 10:05 AM. |
|
09-23-14, 10:05 AM | #8 |
Yes I've noticed with the script and after that is now fixed now it's really good to me. Was the very last thing that has annoyed me personally, before the actual release ^^
|
|
09-23-14, 05:52 PM | #9 |
UnitName will return a valid value for the player unit immediately. However, UnitGUID won't return anything useful until PLAYER_LOGIN. Rather than calling these functions repeatedly in a combat log handler (which runs extremely frequently, and therefore adding 2 function calls there is extremely inefficient) you should register for PLAYER_LOGIN and initialize the variables there.
Also, I don't understand why you're checking the destination name instead of the destination GUID? Just check the GUID like you're doing with the source... Code:
-- at the top: local PlayerGUID -- at the bottom: local AnnounceFrame = CreateFrame("Frame") AnnounceFrame:RegisterEvent("PLAYER_LOGIN") AnnounceFrame:SetScript("OnEvent", function(self, event) PlayerGUID = UnitGUID("player") self:UnregisterEvent("PLAYER_LOGIN") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:SetScript("OnEvent", OnEvent) end) 1. You only register for PLAYER_LOGIN at first. 2. When it fires, store the player's GUID, register for CLEU, and replace the OnEvent handler with the CLEU handler. 3. In the CLEU handler, refer to the stored GUID instead of looking up the same value over and over millions of times per play session.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » Issue with Cooldownannounce-Script |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|