Pergunta

Could someone give an example of how to load and execute .lua script files in windows. I am using ServiceStack redis to loadluascript. It works to certain scripts which don't have module(...) like things.

I am getting this error

Error compiling script (new function): user_script:5: cannot use '...' outside a 
vararg function near '...' , sPort: 61688, LastCommand:

Any help by giving an example would be highly appreciated.

Thanks in advance

Foi útil?

Solução 2

The solution for the above kind Lua script is to prepend local before a function or all variables. I took out the module thing and tweaked the Lua script to make it work. Later I realized the script will not be any use to me :). Thanks for looking into this post.

Outras dicas

It would help if you posted the Lua script you are trying to load or execute.

Three dots don't have anything to do with modules:

Vararg expressions, denoted by three dots ('...'), can only be used 
when directly inside a vararg function

I guess this answers your question: your Lua code is simply invalid.

Speaking of modules: you can't load your own modules in Redis Lua, which you might already know. See http://redis.io Scripting.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top