It is currently May 7th, 2024, 6:02 pm

How do I calculate new variable value?[solved]

Get help with creating, editing & fixing problems with skins
User avatar
SammaySarkar
Posts: 12
Joined: January 21st, 2013, 4:37 am
Location: AFK

How do I calculate new variable value?[solved]

Post by SammaySarkar »

Hi, I'm sure this is an easy problem to solve , but I've just started out Raimetering and right now can't make head or tail of a large part of the RM docs. ( :???: & :confused: )
So, this is basically what I want to achieve:
1. User clicks on a skin element (element completed).
2. This changes the value of a variable. (variable stored in a config file.)
3. Then skin refreshes, now using the new value.

It's the 2nd step that has me stumped.

A bonus problem: I'd also like to know how to use another (constant) variable value to change said variable.
Thank you in advance for any help at all. :)
Last edited by SammaySarkar on January 22nd, 2013, 2:31 pm, edited 2 times in total.
Please turn on Handwriting Recognition to view signatures.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: How do I calculate new variable value?

Post by moshi »

http://docs.rainmeter.net/manual/bangs#WriteKeyValue

Code: Select all

LeftMouseUpAction=[!WriteKeyValue "Variables" "TheVariableYouWantToChange" "#AnotherVariable#" "#@#Variables.inc"][!Refresh "#CURRENTCONFIG#"]
•)
User avatar
SammaySarkar
Posts: 12
Joined: January 21st, 2013, 4:37 am
Location: AFK

Re: How do I calculate new variable value?

Post by SammaySarkar »

moshi wrote:http://docs.rainmeter.net/manual/bangs#WriteKeyValue

Code: Select all

LeftMouseUpAction=[!WriteKeyValue "Variables" "TheVariableYouWantToChange" "#AnotherVariable#" "#@#Variables.inc"][!Refresh "#CURRENTCONFIG#"]
•)
Thanks.
But this is not quite what I need. :(
let's say that, on every click, I want to add 10 to "TheVariableIWantToChange". But I may also need to add something like(10+another variable) too.
And just for now, a code block would be fine... :lol:
Please turn on Handwriting Recognition to view signatures.
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: How do I calculate new variable value?

Post by moshi »

Code: Select all


[Calculation]
Measure=Calc
Formula=((#TheVariableYouWantToChange#)+10)
DynamicVariables=1
UpdateDivider=-1


[Meter]
...
LeftMouseUpAction=[!WriteKeyValue "Variables" "TheVariableYouWantToChange" "[Calculation]" "#@#Variables.inc"][!Refresh "#CURRENTCONFIG#"]

•)
User avatar
SammaySarkar
Posts: 12
Joined: January 21st, 2013, 4:37 am
Location: AFK

Re: How do I calculate new variable value?

Post by SammaySarkar »

Thanks a lot! This is exactly what I was looking for :thumbup: !

Code: Select all

[Calculation]
Measure=Calc
Formula=((#TheVa ... #CURRENTCONFIG#"]
This is what I did.

Code: Select all

[latmove]
Measure=calc
Formula=(#Latitude#+10)

[moveL]
Meter=Button
ButtonImage=move.png
X=(#Height#-10)
Y=(5+(#height#/2))
LeftMouseUpAction=[!WriteKeyValue "Variables" Latitude [latmove] "uservariables.inc"][!Refresh "#CURRENTCONFIG#"]
Thanks again! This was alomst making my hairs go grey. :rolmfao:
Please turn on Handwriting Recognition to view signatures.