alphaCoder
alphaCoder

Reputation: 55

Loading lua script files in redis

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

Upvotes: 0

Views: 2040

Answers (2)

alphaCoder
alphaCoder

Reputation: 55

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.

Upvotes: 0

Tw Bert
Tw Bert

Reputation: 3809

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.

Upvotes: 1

Related Questions