Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trollhunters501/luaenginenk
Run Lua in Nukkit!
https://github.com/trollhunters501/luaenginenk
devs lua minecraft nukkit plugin roblox
Last synced: 10 days ago
JSON representation
Run Lua in Nukkit!
- Host: GitHub
- URL: https://github.com/trollhunters501/luaenginenk
- Owner: Trollhunters501
- License: gpl-3.0
- Created: 2024-03-18T19:41:21.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-19T01:30:10.000Z (2 months ago)
- Last Synced: 2024-11-19T02:38:25.856Z (2 months ago)
- Topics: devs, lua, minecraft, nukkit, plugin, roblox
- Language: JavaScript
- Homepage: https://cloudburstmc.org/resources/luaenginenk.978/
- Size: 43.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LuaEngineNK
![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)
![Lua](https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge&logo=lua&logoColor=white)
![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)Run Lua in Nukkit!
Requirements:
JSEngineNK Plugin: https://cloudburstmc.org/resources/jsenginenk.939/
JSENK2: https://cloudburstmc.org/resources/jsenk2.1017/
Know Basic JavaScript
# Installation:
Easily installed with a JSEngineNK script:```js
const LuaSc = require("LuaEngineNK/org/CreadoresProgram/LuaEngineNK.js");
```
# Engine Creation:
Just add this code to your script and you can use Lua!
```js
var TestLua = new LuaSc.LuaEngineNK().build();
```
# Eval:
```js
TestLua.eval("print('hello world!')");
```
# Default variables:
getLogger return logger by JSEngineNKgetServer return server
manager return manager by JSEngineNK
plugin return main Class by JSEngineNK
# Specify Variables (put):
```js
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:
```js
TestLua.setNnClassLoader({ urls: ["https://test.com/test.jar"] }, {
variable: "class.example"//...
});
```
It also has most of the features of [PHPEngineNK](https://cloudburstmc.org/resources/phpenginenk.968/) (minus code conversion and print)# evalFile:
Run Ruby code from a file:
```js
TestLua.evalFile(manager.getFile("TestLua", "Test.lua"));
```
More Info: https://github.com/luaj/luaj