You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-06-20 09:19:27 +02:00
10 lines
333 B
Plaintext
Vendored
10 lines
333 B
Plaintext
Vendored
VM = OPI_Lua.CreateVM("Lua54");
|
|
|
|
OPI_Lua.AttachPackageFromString(VM, "calc", "local M = {} function M.double(x) return x * 2 end return M");
|
|
|
|
OPI_Lua.ExecuteCodeFromString(VM, "calc = require('calc')");
|
|
|
|
Parameters = New Array;
|
|
Parameters.Add(5);
|
|
|
|
Result = OPI_Lua.CallFunction(VM, "calc.double", Parameters); |