It is currently April 20th, 2024, 9:25 am

To share a lua script or not to share

Discuss the use of Lua in Script measures.
jusjoken
Posts: 2
Joined: January 23rd, 2013, 3:18 pm

To share a lua script or not to share

Post 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
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: To share a lua script or not to share

Post 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.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
jusjoken
Posts: 2
Joined: January 23rd, 2013, 3:18 pm

Re: To share a lua script or not to share

Post 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