Engine:CCMD lua.run: Difference between revisions
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
== Examples == | == Examples == | ||
=== Default values === | === Default values === | ||
<kua> | <kua> | ||
lua run "print(1 + 2)" | lua run "print(1 + 2)" | ||
Line 26: | Line 21: | ||
context lua | context lua | ||
run "print(1 + 3)" | run "print(1 + 3)" | ||
exit | |||
</kua> | </kua> | ||
: Prints '4'. | : Prints '4'. |
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 "print(1 + 2)"
- Prints '3'.
context lua
run "print(1 + 3)"
exit
- Prints '4'.