Skip to content

Commit

Permalink
Advance library.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
softbf395 authored Oct 11, 2024
1 parent 269abd1 commit 8996515
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions source/library.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
#include <lua.hpp>
#include <lauxlib.h>
#include <lualib.h>
#include "lfs.h" // Include the LuaFileSystem header
#include "lfs.h" // LuaFileSystem for file handling
#include <sqlite3.h> // SQLite for database operations
#include <openssl/ssl.h> // OpenSSL for encryption
#include <json/json.h> // JSON parsing
#include <zip.h> // LibZip for compressed files handling

extern "C" int luaopen_mylibrary(lua_State *L) {
luaL_requiref(L, "lfs", luaopen_lfs, 1); // Make sure luaopen_lfs is used correctly
// Load LuaFileSystem
luaL_requiref(L, "lfs", luaopen_lfs, 1);
lua_pop(L, 1); // Remove the library from the stack

// Additional library setup for Roblox executor (if needed)

luaL_dostring(L, "require('main.lua')"); // Run the main.lua file
// Run main Lua script
luaL_dostring(L, "require('main.lua')");

return 0;
}

int main(int argc, char** argv) {
lua_State *L = luaL_newstate();
luaL_openlibs(L);

// Register your custom Lua library
luaopen_mylibrary(L);

// Execute Roblox-related Lua code or executor script
luaL_dofile(L, "executor.lua");

lua_close(L);
return 0;
}

0 comments on commit 8996515

Please sign in to comment.