Function; Rule_AddInterval - HWRM/KarosGraveyard GitHub Wiki
Calls a named function periodically. The name of the function is case-sensitive.
Rule_AddInterval
. The easiest ways to do this are to just write these functions in the same file as the usage of Rule_AddInterval
, or to seperate them into other files and import them via dofilepath
/doscanpath
.
Param | Type | Description |
---|---|---|
function_name |
string |
The name of a function. This function needs to be globally available. Casing DOES matter. |
interval |
string |
The interval (in seconds) between calls to the named function. |
function printTheTime()
print("current gametime: " .. tostring(Universe_GameTime()));
end
-- elsewhere...
-- calls our 'printTheTime' function every 1.25 seconds:
Rule_AddInterval("printTheTime", 1.25);