So I haven't found a way to add a cool down timer to a lua script, certain conditions work but it seems to ignore the cooldown time left condition and continues to spam the lua script ability. Below is the lua script for casting growl, how would I go about implementing a 8 second cooldown before it tries to run the script again?
for i=1,50 do
local spellName, spellSubName = GetSpellBookItemName(i, BOOKTYPE_PET)
if spellName and spellName == "Growl" then
CastSpell(i, BOOKTYPE_PET);
end
end