3 void luaRun::registerScripts() {
4 registerScript("helloworld.lua");
7 void luaRun::registerScript(const std::string name
) {
9 scripts
.push_back(novo
);
12 void luaRun::loadScripts() {
13 std::vector
<Script
>::iterator it
;
14 for (it
= scripts
.begin();it
!= scripts
.end(); it
++) {
15 if (it
->L
!= NULL
) lua_close(it
->L
);
18 if (luaL_dofile(it
->L
, it
->name
.c_str())) {
19 printf("%s\n", lua_tostring(it
->L
, -1));