rex_luavm
Plugin, ACE table, Discussion thread
Dependence:
Dependence:
- (Option) official function plugin
- (Option) rex_timeline plugin
Introduction
Run lua script. The lua vm was referenced from lua.vm.js. This plugin also uses the coroutine feature to maintain a task system.
Note that this plugin only could be used at web exported, and node-webkit exported.
Run lua script. The lua vm was referenced from lua.vm.js. This plugin also uses the coroutine feature to maintain a task system.
Note that this plugin only could be used at web exported, and node-webkit exported.
Usage
Run lua script
Sample capx
Call "Action:Run script" to run lua script in a string parameter. The "print" function of lua script will print message to the console of browser.
Sample capx
Call "Action:Run script" to run lua script in a string parameter. The "print" function of lua script will print message to the console of browser.
Interact with official function object
Sample capx
This plugin provides a lua function named "Call" to invoke the function defined in official function object. The function interface of "Call" is the same as "Expression:Call" of official function object.
Sample capx
This plugin provides a lua function named "Call" to invoke the function defined in official function object. The function interface of "Call" is the same as "Expression:Call" of official function object.
Call( function_name , parameter 0 , parameter 1 , .... )
Task system
Sample capx
The task system of this plugin is using the coroutine feature of lua script. A task could be started, suspended, and resumed. The variables in a task will be keep while task is existed.
Javascript does not support coroutine feature, so that it could not describe a task in a simple single function.
Sample capx
The task system of this plugin is using the coroutine feature of lua script. A task could be started, suspended, and resumed. The variables in a task will be keep while task is existed.
Javascript does not support coroutine feature, so that it could not describe a task in a simple single function.
Start a task
Call "Action:Start" to start a task with a lua function. This lua function need to be injected before by "Action:Run script" first.
Call "Action:Start" to start a task with a lua function. This lua function need to be injected before by "Action:Run script" first.
Suspend a task
Call a lua function "Wait" in this lua task function. The parameter of this "Wait" function could be a number or a string, or none.
"Wait" function with a number parameter,
Call a lua function "Wait" in this lua task function. The parameter of this "Wait" function could be a number or a string, or none.
"Wait" function with a number parameter,
Wait( second )
is to suspend this task until time-out. User need to add rex_timeline plugin into project to use this feature.
"Wait" function with a string parameter
Wait( key )
is to suspend this task until resumed by "Action:Resume with key". And the key parameter of this action must be equal to the locked key in "Wait" function, otherwise the task will not be resumed. Or call "Action:Resume" to resume this task without checking the key.
The "Wait" function with no parameter
Wait( )
will be resumed without checking the key, so that it could be resumed by "Action:Resume", or "Action:Resume with key" with any key parameter.
Resume a task
Call "Action:Resume with key", or "Action:Resume" to resume a task by name, which is suspended by "Wait( key )", "Wait( )". See the previous "Suspend a task" section.
Call "Action:Resume with key", or "Action:Resume" to resume a task by name, which is suspended by "Wait( key )", "Wait( )". See the previous "Suspend a task" section.
Kill tasks
"Action:Kill" could kill a task by name. "Action:Kill all" could kill all tasks.
"Action:Kill" could kill a task by name. "Action:Kill all" could kill all tasks.
Task events
When task starts, suspends, resumes, finishes, or is killed. These conditions "Condition:On started", "Condition:On suspended", "Condition:On resumed", "Condition:On finished", "Condition:On killed" will be triggered. Get the triggered task name by "Expression:TaskName" under these conditions.
When task starts, suspends, resumes, finishes, or is killed. These conditions "Condition:On started", "Condition:On suspended", "Condition:On resumed", "Condition:On finished", "Condition:On killed" will be triggered. Get the triggered task name by "Expression:TaskName" under these conditions.
Reserved objects name
User might not override these lua objects/functions to keep the plugin work correctly.
User might not override these lua objects/functions to keep the plugin work correctly.
- Call
- Wait
- Tasks
- TaskRun
- TaskStart
- TaskResume
- TaskKill
- TaskKillAll