Open alexribeirodesa opened 8 years ago
I made this small code to load the file using the lua lib, with this you can open both raw and binary lua script.
luacppinterface.h: // run a Lua script std::string LoadScript(std::string script);
luacppinterface.cpp: std::string Lua::LoadScript(std::string script) { if (luaL_loadfile(state.get(), script.c_str())) { return LuaGetLastError(state.get()); } lua_pcall(state.get(), 0, LUA_MULTRET, 0);
return "No errors";
}
I made this small code to load the file using the lua lib, with this you can open both raw and binary lua script.
luacppinterface.h: // run a Lua script std::string LoadScript(std::string script);
luacppinterface.cpp: std::string Lua::LoadScript(std::string script) { if (luaL_loadfile(state.get(), script.c_str())) { return LuaGetLastError(state.get()); } lua_pcall(state.get(), 0, LUA_MULTRET, 0);
}