Engine:CCMD run: Difference between revisions

408 bytes removed ,  15 October 2023
Line 15: Line 15:


This very basic syntax structure however lends well to being flexible and extensible, and thus sometimes confusing. A complex base Engine script can interact with many different environments and contexts.
This very basic syntax structure however lends well to being flexible and extensible, and thus sometimes confusing. A complex base Engine script can interact with many different environments and contexts.
An example test script named 'startup.cfg' can look like:
<kua>
context global
bind Y "run startup.cfg" // reload this file
alias testscript '
context lua
{
print("Lua")
local s = ""
for i = 10, 1, -1 do
s = s .. i .. " "
end
io.write(s)
}
exit
context js
{
print("JavaScript");
var s = "";
for (i = 10; i >= 1; i--) s += i + " ";
print(s);
}
exit
'
bind U testscript
</kua>


== Examples ==
== Examples ==