Engine:CCMD lua.lua edit: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{dev/uiccmd}} Runs a Lua statement in a Lua runtime. <kua>print("fred")</kua> == Arguments == * name - (none) * value - the verbatim text of the Lua statement or statements to be run == Associations == * Is by defualt placed in the 'lua' context. * Is the default command for the 'lua' context. * Does not have its own command name in 'lua'. == Details == Can be used to run commands as though were directly in a Lua console, if the statement is not engine command, vari...") |
No edit summary |
||
Line 8: | Line 8: | ||
== Associations == | == Associations == | ||
* Is by | * Is by default placed in the 'lua' context. | ||
* Is the default command for the 'lua' context. | * Is the default command for the 'lua' context. | ||
* Does not have its own command name in 'lua'. | * Does not have its own command name in 'lua'. |
Revision as of 17:59, 17 October 2023
Runs a Lua statement in a Lua runtime.
print("fred")
Arguments
- name - (none)
- value - the verbatim text of the Lua statement or statements to be run
Associations
- Is by default placed in the 'lua' context.
- Is the default command for the 'lua' context.
- Does not have its own command name in 'lua'.
Details
Can be used to run commands as though were directly in a Lua console, if the statement is not engine command, variable or alias in the 'lua' context.
Examples
Default values
Below, 'exit' is a 'lua' context command which simply switches to the 'global' context. It is not run in a Lua runtime.
context lua
print(1 + 2)
exit
Notes
- While 'lua_edit' is intended make console Lua commands easy to run, can allow scripts and other types of macros to avoid lots of situations where complex logic would otherwise be required, by simply switching to the 'lua' context and then running a series of single line lua chunks.