Engine:CCMD run: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Created page with "{{dev/uiccmd}} Load and run script file. Run a named script file. Name must include extension. <kua>run startup.cfg</kua> == Arguments == * name - The name of the script file to load and run. == Associations == * Is by default placed in the 'global' context. == Details == == Examples == === Default values === For a script file named 'startup.cfg' and looks like: <kua> echo fred lua print(1 + 3) alias bob fred var fred james bob </kua> * Try to load a non-existent fil...")
 
Line 33: Line 33:
'fred' is 'james'
'fred' is 'james'
</kua>
</kua>
: In this case: echos 'fred', runs Lua runtime command, creates an alias, creates 'fred' variable that the alias 'bob' will show the value of, runs the 'bob' alias that effectivly prints the value of 'fred' that is 'james'.
: In this case: echos 'fred' to console, runs a Lua statement that adds '1 + 3' and prints the result, creates an alias 'bob', creates 'fred' variable that the alias 'bob' will show the value of, runs the 'bob' alias that effectively prints the value of 'fred' that is 'james'.


== Notes ==
== Notes ==
*
*

Revision as of 18:49, 15 October 2023

Console commands

Load and run script file. Run a named script file. Name must include extension.

run startup.cfg

Arguments

  • name - The name of the script file to load and run.

Associations

  • Is by default placed in the 'global' context.

Details

Examples

Default values

For a script file named 'startup.cfg' and looks like:

echo fred
lua print(1 + 3)
alias bob fred
var fred james
bob
  • Try to load a non-existent file.
> run bob.cfg
Run failed: bob.cfg
  • Run the example script file.
> run startup.cfg
fred
4
'fred' is 'james'
In this case: echos 'fred' to console, runs a Lua statement that adds '1 + 3' and prints the result, creates an alias 'bob', creates 'fred' variable that the alias 'bob' will show the value of, runs the 'bob' alias that effectively prints the value of 'fred' that is 'james'.

Notes