diff options
author | onefang | 2020-02-27 11:18:47 +1000 |
---|---|---|
committer | onefang | 2020-02-27 11:18:47 +1000 |
commit | 34c5ee4c2a489a506e93d5b303fbc80b263747f0 (patch) | |
tree | 53e5f29e16929503a1171a0e251249c0396c5f50 /src/script.lua | |
parent | Add a default gloebit config file, coz it doesn't like it if it doesn't exist. (diff) | |
download | opensim-SC-34c5ee4c2a489a506e93d5b303fbc80b263747f0.zip opensim-SC-34c5ee4c2a489a506e93d5b303fbc80b263747f0.tar.gz opensim-SC-34c5ee4c2a489a506e93d5b303fbc80b263747f0.tar.bz2 opensim-SC-34c5ee4c2a489a506e93d5b303fbc80b263747f0.tar.xz |
The new sledjchisl binary, to replace the management scripts and web stuff.
Diffstat (limited to 'src/script.lua')
-rw-r--r-- | src/script.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/script.lua b/src/script.lua new file mode 100644 index 0000000..1e4b909 --- /dev/null +++ b/src/script.lua | |||
@@ -0,0 +1,18 @@ | |||
1 | -- script.lua | ||
2 | |||
3 | -- This works coz LuaJIT automatically loads the jit module. | ||
4 | if type(jit) == 'table' then | ||
5 | io.write('script.lua is being run by ' .. jit.version .. ' under ' .. jit.os .. ' on a ' .. jit.arch .. '\n') | ||
6 | else | ||
7 | io.write('script.lua is being run by Lua version ' .. _VERSION .. '\n') | ||
8 | end | ||
9 | |||
10 | -- Receives a table, returns the sum of its components. | ||
11 | io.write("The table the script received has:\n"); | ||
12 | x = 0 | ||
13 | for i = 1, #foo do | ||
14 | print(i, foo[i]) | ||
15 | x = x + foo[i] | ||
16 | end | ||
17 | io.write("Returning data back to C\n"); | ||
18 | return x | ||