It is currently April 25th, 2024, 8:42 am

SKIN:Bang() and strings question

Discuss the use of Lua in Script measures.
FlyingHyrax
Posts: 232
Joined: July 1st, 2011, 1:32 am
Location: US

SKIN:Bang() and strings question

Post by FlyingHyrax »

This works:

Code: Select all

SKIN:Bang('[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]')
This does not:

Code: Select all

action = '[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]'
SKIN:Bang("'" .. action .. "'")
What am I missing?
Flying Hyrax on DeviantArt
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SKIN:Bang() and strings question

Post by jsmorley »

FlyingHyrax wrote:This works:

Code: Select all

SKIN:Bang('[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]')
This does not:

Code: Select all

action = '[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]'
SKIN:Bang("'" .. action .. "'")
What am I missing?
Try:

Code: Select all

action = '[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]'
SKIN:Bang(action)
Not sure why you are trying to send single quotes to Rainmeter. Aside from not needing them, Rainmeter doesn't understand them anyway.

The single quotes on this:

Code: Select all

SKIN:Bang('[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]')
Are just to define the string in Lua, Rainmeter never sees them.

In this:

Code: Select all

action = '[!SetOption meterSomeString FontColor 250,100,100][!Update][!Redraw]'
SKIN:Bang(action)
the variable action is defined as a string in the first line, and then just used in the second.
FlyingHyrax
Posts: 232
Joined: July 1st, 2011, 1:32 am
Location: US

Re: SKIN:Bang() and strings question

Post by FlyingHyrax »

jsmorley wrote: Not sure why you are trying to send single quotes to Rainmeter. Aside from not needing them, Rainmeter doesn't understand them anyway.
Ah. Quite right. It's always something obvious (or just plain silly) in hindsight, you know?

Thanks for being here to answer all these questions. The amount of time you spend on this forum is pretty incredible. You have the patience of a saint!

Edit: I mean, geez:
Image
Flying Hyrax on DeviantArt