It is currently April 18th, 2024, 11:39 pm

"Flag" variables? How to code something similar in if actions?

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: "Flag" variables? How to code something similar in if actions?

Post by jsmorley »

Something like:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Reset=1
ResetValue=40
AverageSeconds=10
TargetValue=60

[CPU]
Measure=CPU
MinValue=0
MaxValue=100

[CPUAvg]
Measure=CPU
AverageSize=#AverageSeconds#
IfCondition=(CPUAvg >= #TargetValue#) && (Reset = 1)
IfTrueAction=[Play "#@#Sounds\Alarm.wav"][!SetVariable Reset "0"]
IfCondition2=CPUAvg <= #ResetValue#
IfTrueAction2=[!SetVariable Reset "1"]
DynamicVariables=1
MinValue=0
MaxValue=100

[MeterLine]
Meter=Line
MeasureName=CPU
MeasureName2=CPUAvg
W=200
H=70
LineCount=2
LineColor=59,255,98
LineColor2=255,237,127
HorizontalLines=1
HorizontalLineColor=150,150,150
SolidColor=47,47,47
AutoScale=1

[MeterCPU]
Meter=String
MeasureName=CPU
W=200
Y=0R
FontSize=11
FontWeight=400
FontColor=59,255,98
SolidColor=47,47,47,255
Padding=5,10,-5,5
AntiAlias=1
Text=Current:      %1%

[MeterCPUAvg]
Meter=String
MeasureName=CPUAvg
W=200
Y=0R
FontSize=11
FontWeight=400
FontColor=255,237,127
SolidColor=47,47,47,255
Padding=5,0,-5,5
AntiAlias=1
Text=Average:      %1%
1.png
You do not have the required permissions to view the files attached to this post.
Unatomic
Posts: 33
Joined: October 23rd, 2012, 7:37 pm

Re: "Flag" variables? How to code something similar in if actions?

Post by Unatomic »

Temperature warnings worked like a charm! So the problem with flag variables is solved!

Code: Select all

maxGPU=63
minGPU=53
flagGPU=1

IfCondition=(MeasureGPUtemp >= #maxGPU#) && (#flagGPU# = 1)
IfTrueAction=[Play "#@#Sounds\Alarm.wav"][!SetVariable flagGPU "0"]
IfCondition2=MeasureGPUtemp <= #minGPU#
IfTrueAction2=[!SetVariable flagGPU "1"]
DynamicVariables=1
[hr][/hr]

For some reason Ram check is not working. I see from the log that [MeasureRam] has a range of 0 to 7.9 and not 0 to 100 even if [measureRam] is what I use to display Ram percentage. And the problem is the percentual option. I will mess around to fix this and place the IfCondition check where it needs to be placed but... Yeah... flag variables problem marked as solved!!!

jsmorley once the inspiration starts you need to do what has to be done right??? hehehe I will look into the average cpu measure you so kindly provided right away.

Thanx everyone for the help once again!
Unatomic
Posts: 33
Joined: October 23rd, 2012, 7:37 pm

Re: "Flag" variables? How to code something similar in if actions?

Post by Unatomic »

And just wow!!! I personaly like much more how Average CPU works and I removed current cpu from showing!!! Warning on average CPU also works fine! Thanx for the ideas and for the help!

Here is some eyecandy
Screenshot_3.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: "Flag" variables? How to code something similar in if actions?

Post by jsmorley »

Looks nice!
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: "Flag" variables? How to code something similar in if actions?

Post by jsmorley »

Unatomic wrote: For some reason Ram check is not working. I see from the log that [MeasureRam] has a range of 0 to 7.9 and not 0 to 100 even if [measureRam] is what I use to display Ram percentage. And the problem is the percentual option.
Memory is not measured as a percentage, but is measured in Bytes. The MinValue and MaxValue are automatically set based on the total Memory (which it knows), so using the value as a percentage, in a Bar or Histogram or Line or Rotator or Roundline meter for instance, or with Percentual=1 on a String meter, will work, as those meters and that variant of the String meter know how to do the math based on the MaxValue.

If you want to use the percentage in an IFCondition test, you will need to do something like:

IfCondition=((MeasureRAM / [MeasureRAM:MaxValue]) * 100) > 50
IfTrueAction=[!Log "Greater than 50 percent"]
DynamicVariables=1