Thread Tools Display Modes
05-02-10, 03:29 AM   #1
upyursh
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 32
GetSpellCooldown() issue

I'm having an oddity with GetSpellCooldown

Code:
local start, duration, enabled = GetSpellCooldown("Innervate");
if ( start > 0 and duration > 0) then
  print("Innervate is on cooldown")
else
  print("Cast Innervate now")
end
this works generally but if I am casting another ability when this is triggered it will report that innervate is on cooldown.

Is there a way around this? :/

Upy
  Reply With Quote
05-02-10, 03:33 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
What you are seeing is the GCD (Global Cooldown) which is by default 1.5 seconds long (without any haste) so if you make sure you check if the cooldown is above 1.5 before doing anything then it should be solved.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
05-02-10, 04:44 AM   #3
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Code:
local start, duration, enabled = GetSpellCooldown("Innervate");
if ( start > 0 and duration > 1.5) then
  print("Innervate is on cooldown")
else
  print("Cast Innervate now")
end
Fixed.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetSpellCooldown() issue


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