Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 769

Lua Scripting • Talking with Lua...

$
0
0
I think the correct way to write it would be [!SetOption meter fontcolor "[&*Script:function('[#*Color*]')*]"] (notice the order of &, #, and *). Also, in case you need this one day, you can "multiescape" things, like, for example, [#**Color**] and such (useful if you nest escaped stuff in variables)...
Hey Yin, Interesting, In my first tests it seemed to me that [*#Color*] was exactly the same as [#*Color*]. Since it didn't appear to make any difference. Same for [*&Measure*] and [&*Measure*]. But [*&Measure[*#Color*]*] is not the same as [&*Measure[#*Color*]*] apparently.... Anyway, any of these syntaxes solved my problem.

The thing is that the function is trying to solve literal [#*Color*] on first load and it logs attempt to perform arithmetic on a nil value, But it works fine. I just want to get rid of the error.

I've tried [!SetOption Meter Option " "]:

"[&*Measure:function('[#Variable]')*]" - Variable no longer dynamic, no errors.
"[*&Measure:function('[#Variable]')*]" - Same outcome.

"[&*Measure:function('[*#Variable*]')*]" - Does not work at all, no errors.
"[*&Measure:function('[*#Variable*]')*]" - Same outcome.

"[&*Measure:function('[#*Variable*]')*]" - Works fine, dynamic variable, logs error on first load.
"[*&Measure:function('[#*Variable*]')*]" - Does not work at all, no errors.

So, "[&*Measure:Function('[#*Variable*]')*]" is the only one that works but logs an error because it's trying to solve [#*Variable*] literally at first.

If I use it in a measure and that measure on a meter, for example:

Code:

[DynamicColor]Measure=StringString=[&*Measure:function('[#*DynamicVariable*]')*]DynamicVariables=1[Meter]Meter=StringFontColor=[&DynamicColor]DynamicVariables=1
It works fine, no errors at all.

All of this leads me to think that although it may not be a bug, it may very well be a flaw on the Escaping syntax exclusively on set options or, much more probable, there's a lot more I need to learn.

Statistics: Posted by RicardoTM — Today, 8:30 am — Replies 4 — Views 7993



Viewing all articles
Browse latest Browse all 769

Trending Articles