Laaglander wrote: ↑December 24th, 2023, 3:03 am
Hello,
I have a question.
I have 2 skins. 1 of those needs to sent his data to the other one.
From the sending script
[MeasureSentValue]
[!SetVariable MeasureSentValue "[MeasureSending]" "D:\Users\xxxxx\Documents\Rainmeter\Skins\crypto_eigen\crypto_eigen.ini"]
recieving script
[MeasureSentValue]
Measure=String
MeasureName=MeasureSentValue
[MeterSentValue]
Meter=String
MeasureName=MeasureSentValue
Text="geinvesteerd van de 2de: [MeasureSentValue]"
X=5
Y=20r
FontSize=13
FontColor=#FFFFFF#
DynamicVariables=1
but this isnt working.. How should i do it?
Mischa
There are some problems with your codes:
1) In your case, both your sending script and your receiving script transfer data between measures that are named the same (i.e. [MeasureSentValue]). Now, since those scripts should be different .ini files placed in different folders (aka different skins), this is not a problem, but it will confuse you a bit (a more logical naming would have been [MeasureSentValue] in your sending script and [MeasureReceivedValue] in your receiving script, but we'll go with your current naming for the time being).
2) In your case, while sending the value of a variable is entirely possible if you wanted to, this is not the case since in your code, the receiving element is a measure and not a variable. Therefore, you should use !SetOption here, and not !SetVariable, while also taking into account that !SetOption will need to know the name of the option you're setting as well (so it will have one more parameter compared to !SetVariable).
3) Since you'd be using [MeasureSentValue] in a bang to refer to its value, that measure should have a DynamicVariables=1 line added to it.
4) Without a Measure=SomeMeasureTypeHere option, the [MeasureSentValue] from your sending script will be invalid and not represent a measure in the first place, so you should make sure that you define a Measure=... option in that section, e.g. Measure=String to match the receving measure's type.
5) Unless your sending code actually has a valid [MeasureSending] measure that you didn't post here, that part is invalid as well, since the only measure in the sending script that you posted is called [MeasureSent] (see the 1) point about the naming confusion)
6) Finally, the last parameter of your incorrect !SetVariable bang (and the correct !SetOption bang for this code) should be the config name of your skin, and not its path. In your case, that will simply be "crypto_eigen" (i.e. the folders that come after your "D:\...\Skins\" skins' folder in your path).
7) Since your receiving element is a measure, that measure would optionally have to be updated and your receiving skin be redrawn in order to see the change right away (otherwise the change will be visible based on the receiving skin's Update value from its [Rainmeter] section, by default 1000 ms aka 1 second)
So, your codes should be along these lines...
Sending Skin:
Code: Select all
[MeasureSendingValue]
Measure=String
String=I'm The Value Sent From A Measure In Another Skin!
OnUpdateAction=[!SetOption MeasureRecevingValue String "[MeasureSendingValue]" "crypto_eigen"]
DynamicVariables=1
[SomeMeter]
Meter=String
MeasureName=MeasureSendingValue
Text="A Skin Must Have At Least One Valid Meter: [MeasureSendingValue]"
X=5
Y=20r
FontSize=13
FontColor=255,255,255,255
DynamicVariables=1
Receiving Skin:
Code: Select all
[MeasureReceivingValue]
Measure=String
String=I'm The Current Value Of The Receiving Measure!
[MeterReceivingValue]
Meter=String
MeasureName=MeasureReceivingValue
Text="geinvesteerd van de 2de: [MeasureReceivingValue]"
X=5
Y=20r
FontSize=13
FontColor=255,255,255,255
DynamicVariables=1