while ((ep = readdir (dp)) != NULL)
{
if(str_ends_with(ep->d_name, ".lua"))
while ((ep = readdir (dp)) != NULL)
{
if(str_ends_with(ep->d_name, ".lua"))
-int CmdScript(const char *Cmd)
-{
- CmdsParse(CommandTable, Cmd);
- return 0;
+int CmdScript(const char *Cmd) {
+ clearCommandBuffer();
+ CmdsParse(CommandTable, Cmd);
+ return 0;
char buf[256];
snprintf(buf, sizeof buf, "./scripts/%s%s", script_name, suffix);
char buf[256];
snprintf(buf, sizeof buf, "./scripts/%s%s", script_name, suffix);
- printf("--- Executing: %s, args'%s'\n",buf,arguments);
-
-
-
+ printf("--- Executing: %s, args'%s'\n", buf, arguments);
lua_pushstring(lua_state, arguments);
lua_setglobal(lua_state, "args");
lua_pushstring(lua_state, arguments);
lua_setglobal(lua_state, "args");