Page 1 of 1

To share a lua script or not to share

Posted: January 23rd, 2013, 5:29 pm
by jusjoken
I have 2 skins that are not variants and may or may not be active at the same time. Each has a need for handling some of the functionality within a lua script and will also share some common lua functions.

Question 1: should I / can I use a single lua script for both of these skins?

Question 2: if I share the script, are the 2 skins able to share lua variables within the script. Example if the lua script Initialize sets a Variable ABC=1 and then Skin 1 calls a lua function to change ABC=2, if Skin 2 checks that value, will it be 2 or still 1?

I hope that makes sense.

Thanks
k

Re: To share a lua script or not to share

Posted: January 24th, 2013, 1:15 am
by smurfier
You can use the same script for multiple skins. I cannot advise if you should or not because I don't know what you're doing.

They will not share any variables because they will be running as two separate scripts even though they originate from the same file.

Re: To share a lua script or not to share

Posted: January 24th, 2013, 5:58 pm
by jusjoken
Thanks for your response.... I am new to Rainmeter but it is a great set of tools and the lua scripting adds a lot of power. The forums and samples have been a great help...

I am sure I will have more questions moving forward as I build a set of skins to work with SageTV to display the Weather and Media information pulled from SageTV as the source to compliment the Gemstone for SageTV plugin that I also work on.

k