Run Lua in Nukkit!
Requirements:
JSEngineNK Plugin: https://cloudburstmc.org/resources/jsenginenk.939/
LuaLib Plugin: https://github.com/Trollhunters501/LuaLib
Know Basic JavaScript
Easily installed with a JSEngineNK script:
if(!script.getScriptByName("LuaEngineNK")){
load("https://cdn.jsdelivr.net/gh/Trollhunters501/LuaEngineNK/src/Creadores/Program/LuaEngineNK.js");
}
Just add this code to your script and you can use Lua!
var TestLua = new LuaEngineNK().build();
TestLua.eval("print('hello world!')");
getLogger return logger by JSEngineNK
getServer return server
manager return manager by JSEngineNK
plugin return main Class by JSEngineNK
TestLua.put("Variable", objectJava);
//also applies to setNnClassLoader!
This function does the same thing as JSEngineNK's Nnclassloader API but passed to Lua example:
TestLua.setNnClassLoader({ urls: ["https://test.com/test.jar"] }, {
variable: "class.example"//...
});
It also has most of the features of PHPEngineNK (minus code conversion and print)
Run Ruby code from a file:
TestLua.evalFile(manager.getFile("TestLua", "Test.lua"));
More Info: https://github.com/luaj/luaj