Function; Rule_Exists - HWRM/KarosGraveyard GitHub Wiki
Rule_Exists(<function_name>)
Description
Checks to see whether the named rule function has been registered as a rule via Rule_AddInterval
.
Arguments
Param |
Type |
Description |
function_name |
string |
The name of a function. Casing DOES matter. |
Returns
Type |
Description |
number (boolean) |
Returns 1 in the case the rule is registered. Returns 0 otherwise. |
Example
function updateTimer()
-- your code here...
end
print("rule exists?: " .. tostring(Rule_Exists("updateTimer")); -- should be 0 before the call to `Rule_AddInterval`
Rule_AddInterval("updateTimer", 1); -- calls our 'updateTimer' function every 1s:
print("rule exists?: " .. tostring(Rule_Exists("updateTimer")); -- should be 1 after the call to `Rule_AddInterval`
Related Pages