Engine:CCMD lua.run: Difference between revisions
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
== Examples == | == Examples == | ||
=== Default values === | === Default values === | ||
<kua> | |||
lua run | |||
> Usage: run <code> | |||
</kua> | |||
: Prints '3'. | |||
<kua> | <kua> | ||
lua run "print(1 + 2)" | lua run "print(1 + 2)" | ||
</kua> | </kua> | ||
: Prints '3'. | : Prints '3'. | ||
<kua> | |||
context lua | |||
run "print(1 + 3)" | |||
</kua> | |||
: Prints '4'. | |||
== Notes == | == Notes == | ||
* | * |
Revision as of 20:21, 18 October 2023
Runs a Lua statement in a Lua runtime.
lua run 'print("fred")'
Arguments
- script - the verbatim text of the Lua statement or statements to be run
Associations
- Is by default placed in the 'lua' context.
Details
Runs the first argument as a single Lua code block in a Lua runtime.
Examples
Default values
lua run > Usage: run <code>
- Prints '3'.
lua run "print(1 + 2)"
- Prints '3'.
context lua
run "print(1 + 3)"
- Prints '4'.