LuaEngineNK

Experimental LuaEngineNK 1.0

Compatible API Versions
1.0.0 and higher
Contributors
Creadores Program
Requirements:
JSEngineNK Plugin: https://cloudburstmc.org/resources/jsenginenk.939/
LuaLib Plugin: https://github.com/Trollhunters501/LuaLib
Know Basic JavaScript
Installation:
Easily installed with a JSEngineNK script
JavaScript:
if(!script.getScriptByName("LuaEngineNK")){
   load("https://cdn.jsdelivr.net/gh/Trollhunters501/LuaEngineNK/src/Creadores/Program/LuaEngineNK.js");
}
Engine Creation:
Just add this code to your script and you can use Lua!
JavaScript:
var TestLua = new LuaEngineNK().build();
Eval:
JavaScript:
TestLua.eval("print('hello world!')");
Default variables:

getLogger return logger by JSEngineNK
getServer return server
manager return manager by JSEngineNK
plugin return main Class by JSEngineNK
Specify Variables (put):
JavaScript:
TestLua.put("Variable", objectJava);

//also applies to setNnClassLoader!
setNnClassLoader:
This function does the same thing as JSEngineNK's Nnclassloader API but passed to Lua example:
JavaScript:
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)
evalFile:
Run Lua code from a file:
JavaScript:
TestLua.evalFile(manager.getFile("TestLua", "Test.lua"));
More Info: https://github.com/luaj/luaj
Author
Trollhunters501
Downloads
47
Views
181
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Trollhunters501

Latest updates

  1. JSdelivr Update

    Now the plugin is in JSdelivr!(See description)
Top