get_gcd
The get_gcd function retrieves the remaining duration of the global cooldown (GCD) for the player. This function is useful for determining when the player can cast their next spell.
Parameters
This function does not take any parameters.
Returns
remaining_gcd(number): The remaining duration of the global cooldown in seconds. Returns 0 if there is no active global cooldown.
Example Usage in Lua
Here is an example of how to use the get_gcd function in Lua:
local api = ...
-- Function to print the remaining duration of the global cooldown
function PrintGCD()
local remaining_gcd = api.get_gcd()
print("Remaining GCD: " .. remaining_gcd .. " seconds")
end
-- Example usage: Print the remaining duration of the global cooldown
PrintGCD()