util.resource.is_running
Shared
Checks whether a resource is currently running
Syntax
local result = util.resource.is_running(
name
)Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of the resource to check |
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true if the resource is currently running, false otherwise |
Examples
if util.resource.is_running("my_resource") then
core.engine.print("info", "Resource is running")
endif not util.resource.is_running("inventory_resource") then
core.engine.print("warn", "inventory_resource is not running")
return
end
local items = util.export.call("inventory_resource", "get_items")
core.engine.iprint(items)