It is currently April 26th, 2024, 7:12 am

What did i break?

Get help with creating, editing & fixing problems with skins
User avatar
ForceX
Posts: 100
Joined: January 16th, 2010, 10:32 pm

What did i break?

Post by ForceX »

I had this working but now i think i broke Something. Here is my test script.

Using the Rainmeters About window to see the values; why does [Calc_Tester] not return a value of 1 or 2?

Code: Select all

[Rainmeter]

[Detect_OS]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=ProductName
Substitute="Windows XP":"0","Windows XP Professional":"0","Windows Vista(TM) Home":"1","Windows Vista(TM) Home Premium":"1","Windows Vista(TM) Professional":"1","Windows Vista(TM) Ultimate":"1","Windows 7 Home":"1","Windows 7 Home Premium":"1","Windows 7 Professional":"1","Windows 7 Ultimate":"1"

[String_Tester]
Meter=String
MeasureName=Detect_OS
Text=
X=0
Y=0
fontcolor=255,255,255,255

[Calc_Tester]
Measure=Calc
Formula=(Detect_OS)


[background]
Meter=Image
H=100
W=100
SolidColor=255,255,255,50
Last edited by smurfier on November 21st, 2011, 4:20 pm, edited 11 times in total.
Reason: Added code tags.
User avatar
Jkon
Posts: 185
Joined: December 4th, 2009, 2:05 am

Re: What did i break?

Post by Jkon »

The read out on mine does not match any of your substitutions.theres a (TM) in mine-Windows vista(TM) Home Premium.That (TM) might be in the others aswell.
Image
User avatar
ForceX
Posts: 100
Joined: January 16th, 2010, 10:32 pm

Re: What did i break?

Post by ForceX »

Jkon wrote:The read out on mine does not match any of your substitutions.theres a (TM) in mine-Windows vista(TM) Home Premium.That (TM) might be in the others aswell.
Thanks for the heads up.

Windows 7 is only reporting " Windows 7 Professional ". If you are on Vista and it's putting a (TM) at the end then I'll update as necessary. Can others confirm please?

Any thoughts on the image?

The image has Formula=Detect_OS i have tried Formula=(Detect_OS) as well.
You do not have the required permissions to view the files attached to this post.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: What did i break?

Post by Alex2539 »

Change it to "Formula=[Detect_OS]" and add the line "DynamicVariables=1". When you use the value of a measure in a Calc, it uses the actual value, ignoring the substitutions, which is convenient when you're doing it the other way around (ie: turning numbers into strings). However, as it is, you're feeding the measures something like "Windows XP Professional" which it has no clue how to deal with. To make it see the substitution, you must use the measure as a dynamic variable.
ImageImageImageImage
User avatar
ForceX
Posts: 100
Joined: January 16th, 2010, 10:32 pm

Re: What did i break?

Post by ForceX »

YES!!!!

Fantastic! Thank you for that.... :D

Now i can have my skin set the network connections automatically based on the Xp /vista,7 difference