spell_cooldown
The spell_cooldown function retrieves the remaining cooldown time for a specified spell. This function is useful for determining when a spell will be ready to cast again.
Parameters
spell(string or number): The name or ID of the spell to check.
Returns
remaining_cooldown(number): The remaining cooldown time for the specified spell in seconds. Returns 0 if the spell is not on cooldown or if the spell information is not available.
Example Usage in Lua
Here is an example of how to use the spell_cooldown function in Lua:
local api = ...
-- Function to print the remaining cooldown time for a specified spell
function PrintSpellCooldown(spell)
local remaining_cooldown = api.spell_cooldown(spell)
print("The spell '" .. spell .. "' has a remaining cooldown of " .. remaining_cooldown .. " seconds.")
end
-- Example usage: Print the remaining cooldown time for the spell "Fireball"
PrintSpellCooldown("Fireball")