Difference between revisions of "Scripting"
(→Interpreter Lifespan) |
|||
Line 14: | Line 14: | ||
== Interpreter Lifespan == | == Interpreter Lifespan == | ||
− | When a script is [[Command System: Executing Scripts|executed]], the interpreter for that language is spawned, the script is parsed and executed, and the interpreter is destroyed. Each interpreter exists only for the life of the executing script, and does not persist beyond that. This ensures that each interpreter has its own unique state. | + | When a script is [[Command System: Executing Scripts|executed]], the [[TextScriptInterpreter Object|interpreter]] for that language is spawned, the script is parsed and executed, and the interpreter is destroyed. Each interpreter exists only for the life of the executing script, and does not persist beyond that. This ensures that each interpreter has its own unique state. |
== Support Commands == | == Support Commands == |
Revision as of 18:50, 20 February 2012
Scripting provides an alternative to plug-ins for extending modo. Scripts can be used to automate or streamline processes for the user.
Supported Languages
modo supports four scripting languages:
- Macros, the simplest script, which simply executes a series of commands in order.
- Perl, a powerful language known for its string processing
- Python, an object-based language with exception handling
- Lua, a popular embedded language often used in game development
Click the links above to see articles detailing how to use each language with modo.
Interpreter Lifespan
When a script is executed, the interpreter for that language is spawned, the script is parsed and executed, and the interpreter is destroyed. Each interpreter exists only for the life of the executing script, and does not persist beyond that. This ensures that each interpreter has its own unique state.
Support Commands
Each scripting language has its own series of extensions that allow them to interact with modo. For the most part, these focus on executing and querying commands.
There are a few commands that exist primarily for use by the scripting system.
- query, used to query ScriptQuery interfaces.
- Dialog commands, used to open system dialogs and choice simple dialogs.
- User Values, used to store script state in the config and provide basic user interfaces for scripts.