Quantcast
CooldownFrame_SetTimer - WoWInterface
 
Thread Tools Display Modes
07-23-16, 02:41 AM   #1
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
Question CooldownFrame_SetTimer

Hello everyone,

I was using that script before to watch my trinket proc etc, but it doesn't work enymore. Dunno why
Can anyone take a look and help me fix it?

Lua Code:
  1. local t=CreateFrame("FRAME")
  2. t:SetPoint("CENTER",ParentUI,2,12)
  3. t:SetSize(30,30)
  4. t.c=CreateFrame("Cooldown","cd1")
  5. t.c:SetAllPoints(t)
  6. t.t=t:CreateTexture(nil,"BORDER")
  7. t.t:SetAllPoints()
  8. t.t:SetTexture("Interface\\Icons\\spell_holy_crusaderstrike")
  9. t:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  10.  
  11. t:SetScript("OnEvent", function(...)
  12.     local b,_,_,e,_,_,_,_,_,_,l = select(4, ...)
  13.         if (e == UnitName("Player") and (b=="SPELL_AURA_APPLIED" or b=="SPELL_AURA_REFRESH")and l==209785) then CooldownFrame_SetTimer(cd1,GetTime(),15,1) end end)

Im getting following errors in game:
Lua Code:
  1. Message: Interface\AddOns\Frames\ExtraCD.lua:13: attempt to call global 'CooldownFrame_SetTimer' (a nil value)
  2. Time: 07/23/16 10:39:12
  3. Count: 3
  4. Stack: Interface\AddOns\Frames\ExtraCD.lua:13: in function <Interface\AddOns\Frames\ExtraCD.lua:11>
  5.  
  6. Locals: b = "SPELL_AURA_APPLIED"
  7. _ = false
  8. _ = "Player-3687-05F192B7"
  9. e = "Dasté"
  10. _ = 1297
  11. _ = 0
  12. _ = "Player-3687-05F192B7"
  13. _ = "Dasté"
  14. _ = 1297
  15. _ = 0
  16. l = 209785
  17. (*temporary) = nil
  18. (*temporary) = cd1 {
  19.  0 = <userdata>
  20. }
  21. (*temporary) = 414616.146
  22. (*temporary) = 15
  23. (*temporary) = 1
  24. (*temporary) = "attempt to call global 'CooldownFrame_SetTimer' (a nil value)"

Thanks in advance.
 
07-23-16, 02:53 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
It was renamed to CooldownFrame_Set, you should be able to just swap them out.
 
07-23-16, 03:40 AM   #3
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
Works great! Thanks.

One more question

Can I make the icon appear only when cooldown/timer starts?

Last edited by plopek : 07-23-16 at 03:46 AM.
 
07-23-16, 04:02 AM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
Originally Posted by plopek View Post
Can I make the icon appear only when cooldown/timer starts?
Something like this would probably work.
Lua Code:
  1. local t=CreateFrame("FRAME")
  2. t:SetPoint("CENTER",ParentUI,2,12)
  3. t:SetSize(30,30)
  4. t.c=CreateFrame("Cooldown","cd1")
  5. t.c:SetAllPoints(t)
  6. t.t=t:CreateTexture(nil,"BORDER")
  7. t.t:SetAllPoints()
  8. t.t:SetTexture("Interface\\Icons\\spell_holy_crusaderstrike")
  9. t:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  10.  
  11. t:Hide()
  12. cd1:HookScript('OnHide', function() t:Hide() end)
  13.  
  14. t:SetScript("OnEvent", function(...)
  15.     local b,_,_,e,_,_,_,_,_,_,l = select(4, ...)
  16.     if (e == UnitName("Player") and (b=="SPELL_AURA_APPLIED" or b=="SPELL_AURA_REFRESH")and l==209785) then
  17.         t:Show()
  18.         CooldownFrame_SetTimer(cd1,GetTime(),15,1)
  19.     end
  20. end)
 
07-23-16, 04:37 AM   #5
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
Works great so far however I'd like to add one more function to this. I want to track my Divine Purpose proc but this spell is consumed on use. Can we make it so icon disappear when buff isn't there enymore? Thanks
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » CooldownFrame_SetTimer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off