It is currently September 20th, 2019, 9:17 pm

SKIN:Bang() and strings question

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

SKIN:Bang() and strings question

FlyingHyrax » December 21st, 2013, 1:11 am

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: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SKIN:Bang() and strings question

jsmorley » December 21st, 2013, 1:31 am

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: 251
Joined: July 1st, 2011, 1:32 am
Location: US

Re: SKIN:Bang() and strings question

FlyingHyrax » December 21st, 2013, 2:31 am

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