It is currently May 1st, 2024, 1:35 am

concept with numbers

Get help with creating, editing & fixing problems with skins
Bekarfel
Posts: 217
Joined: May 16th, 2012, 5:38 am

concept with numbers

Post by Bekarfel »

hello this is my first time trying to work on a script. I have no understanding of how the scripting elements work together. I'm trying to have a meter where it takes the current 3 values (a measure's current value & the same measure's last value & the measure's previous value) and uses them to calculate the current value desired.

can I use a single measure to store these values, or would I have to use separate measures?

also, when saving the values, will saving them as
v3 = v2
v2 = v1
v1 = vM
work?
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
Bekarfel
Posts: 217
Joined: May 16th, 2012, 5:38 am

Re: concept with numbers

Post by Bekarfel »

to clarify the OP I am trying to create a variable that would be the square root of the average of the sum of v1, v2, and v3; where v1 is the square of the current MeasureCPU value, v2 is the squared MeasureCPU value from 1 update ago, and V3 is the squared MeasureCPU value from 2 updates ago
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: concept with numbers

Post by poiru »

Assuming you are on a recent Rainmeter 2.3 beta, the following will calculate the RMS (for n = 3):

Code: Select all

[Delay2]
Measure=Calc
Formula=Delay1

[Delay1]
Measure=Calc
Formula=Delay0

[Delay0]
Measure=CPU

[RMS]
Measure=Calc
Formula=SQRT((Delay0**2 + Delay1**2 + Delay2**2) / 3)
If an average will suffice, you could also simply use:

Code: Select all

[Avg]
Measure=CPU
AverageSize=3