Engine:CLUA script

From AddOn Studio
Revision as of 23:03, 18 October 2023 by Bear (talk | contribs) (Created page with "{{dev/uiclua}} Runs an engine script from the Lua runtime. <kua>script "var bob fred"</kua> == Arguments == * script - the block of text to be run as a script in the engine. == Associations == * Is by default placed in the default Lua runtime. == Details == A global Lua runtime function that runs a script from Lua. == Examples == === Default values === From Lua creates an engine variable 'bob' and prints its value: <lua> script 'var bob fred;bob' </lua> In Lua creat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Console commands

Runs an engine script from the Lua runtime.

script "var bob fred"

Arguments

  • script - the block of text to be run as a script in the engine.

Associations

  • Is by default placed in the default Lua runtime.

Details

A global Lua runtime function that runs a script from Lua.

Examples

Default values

From Lua creates an engine variable 'bob' and prints its value:

script 'var bob fred;bob'

In Lua creates a function that sets and prints a variable, and then runs it from engine script, all from inside Lua.

function alan(s) script 'bob ' + s + ';bob' end
script "lua alan('fred')"
Prints 'fred'

Notes