It is currently March 28th, 2024, 9:55 pm

Is this supposed to crash Rainmeter?

General topics related to Rainmeter.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Is this supposed to crash Rainmeter?

Post by kyriakos876 »

Hello, I have these 3 meters:

Code: Select all

[MeterPlayPause]
Meter=String
X=(201*#WVar#+#SO#)
Y=(-32*#HVar#)r
MeterStyle=Symbols
Text=[#[&MeasurePlayPause]]
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "PlayPause"]
MouseOverAction=[!SetVariable AlphaName "Alpha#CurrentSection#"][!CommandMeasure MeasureAnimation "Stop 5"][!CommandMeasure MeasureAnimation "Execute 4"]
MouseLeaveAction=[!CommandMeasure MeasureAnimation "Stop 4"][!CommandMeasure MeasureAnimation "Execute 5"]
DynamicVariables=1

[MeterNext]
Meter=String
X=(15*#WVar#)R
Y=r
MeterStyle=Symbols
Text=[\xe044]
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Next"]
MouseOverAction=[!SetVariable AlphaName "Alpha#CurrentSection#"][!CommandMeasure MeasureAnimation "Stop 5"][!CommandMeasure MeasureAnimation "Execute 4"]
MouseLeaveAction=[!CommandMeasure MeasureAnimation "Stop 4"][!CommandMeasure MeasureAnimation "Execute 5"]
DynamicVariables=1

[MeterPrevious]
Meter=String
X=(-70*#WVar#)r
Y=r
MeterStyle=Symbols
Text=[\xe045]
LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Previous"]
MouseOverAction=[!SetVariable AlphaName "Alpha#CurrentSection#"][!CommandMeasure MeasureAnimation "Stop 5"][!CommandMeasure MeasureAnimation "Execute 4"]
MouseLeaveAction=[!CommandMeasure MeasureAnimation "Stop 4"][!CommandMeasure MeasureAnimation "Execute 5"]
DynamicVariables=1
and this measure:

Code: Select all

[MeasureAnimation]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideOut, 16, 39 | Round | Wait 3700 | Repeat SlideIn, 16, 33 | Reset
ActionList2=Repeat SlideOut, 16, 39 | Round
ActionList3=Round | Repeat SlideIn, 16, 33 | Reset
SlideOut=[!SetVariable A (Clamp(#A#+9,0,255))][!SetVariable SO (Clamp(#SO#-(#SO#*0.125*#Wvar#),0,(300*#WVar#)))]#UR#
Round=[!SetVariable SO "0.91"]#UR#
SlideIn=[!SetVariable A (Clamp(#A#-3,0,255))][!SetVariable SO (Clamp(#SO#+(#SO#*0.2*#WVar#),0,(300*#WVar#)))]#UR#
Reset=[!SetVariable A 0][!Update]
ActionList4=Repeat IconAnimationIn, 16, 10
IconAnimationIn=[!SetVariable #AlphaName# (Clamp([#[#AlphaName]]+25,0,255))][!Update]
ActionList5=Repeat IconAnimationOut, 16, 10
IconAnimationOut=[!SetVariable #AlphaName# (Clamp([#[#AlphaName]]-25,0,255))][!Update]
Now all we need from this measure is ActionList4 and ActionList5, the others serve something irrelevant.

So, I have these variables:

Code: Select all

[Variables]
AlphaName=AlphaMeterPlayPause
AlphaMeterPlayPause=0
AlphaMeterNext=0
AlphaMeterPrevious=0
If I don't define for example, AlphaMeterPrevious=0 and try to mouse over [MeterPrevious], it will try to Clamp with a nested variable that is not defined. So I my Variables are:

Code: Select all

[Variables]
AlphaName=AlphaMeterPlayPause
AlphaMeterPlayPause=0
AlphaMeterNext=0
Note that I did not define AlphaMeterPrevious=0

and mouse over [MeterPrevious], Rainmeter will crash. I don't know if this is expected behavior, like when you put [!Update] on a measure and create a loop, so I thought I'd report it.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is this supposed to crash Rainmeter?

Post by balala »

Post the full code please, because it is very hard to test with partial code.
Or if the code uses some resources as well, pack the config and upload it.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Is this supposed to crash Rainmeter?

Post by kyriakos876 »

balala wrote:Post the full code please, because it is very hard to test with partial code.
Or if the code uses some resources as well, pack the config and upload it.
I've made a lot of changes to the skin since that "bug" was spotted and I cannot seem to recreate it with my current code. I will try and use the parts of code I posted above in order to recreate it.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is this supposed to crash Rainmeter?

Post by balala »

kyriakos876 wrote:I've made a lot of changes to the skin since that "bug" was spotted and I cannot seem to recreate it with my current code. I will try and use the parts of code I posted above in order to recreate it.
Ok, as you want.