IsResourceRunning: Difference between revisions
Jump to navigation
Jump to search
| (6 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
You can insert this code example in your resources. | *'''isResourceRunning''' You can insert this code example in your resources. | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''isResourceRunning:''' The value to check resources | *'''isResourceRunning:''' The value to check resources | ||
==Example== | ==Example check isResourceRunning(resName)== | ||
<section name=" | <section name="isResourceRunning" class="shared" show="true"> | ||
You can insert this code example in your resources. | You can insert this code example in your resources. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function isResourceRunning(resName) | function isResourceRunning(resName) | ||
local res = getResourceFromName(resName) | |||
return (res) and (getResourceState(res) == "running") | |||
end | end | ||
| Line 24: | Line 24: | ||
--alert | --alert | ||
end | end | ||
addCommandHandler('pos', function (commandName) | addCommandHandler('pos', function (commandName) | ||
| Line 34: | Line 33: | ||
end | end | ||
end ) | end ) | ||
]] | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 40: | Line 40: | ||
==See Also== | ==See Also== | ||
{{Resource_functions}} | {{Resource_functions}} | ||
Latest revision as of 03:41, 2 April 2026
Syntax
- isResourceRunning You can insert this code example in your resources.
Required Arguments
- isResourceRunning: The value to check resources
Example check isResourceRunning(resName)
See Also
- abortRemoteRequest
- call
- fetchRemote
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceName
- getResourceRootElement
- getResourceState
- getThisResource
- getRemoteRequests
- getRemoteRequestInfo