It is currently October 21st, 2019, 4:01 am

Is this supposed to crash Rainmeter?

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

Is this supposed to crash Rainmeter?

kyriakos876 » May 25th, 2018, 11:30 pm

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: 8871
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is this supposed to crash Rainmeter?

balala » May 26th, 2018, 2:37 pm

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: 915
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Is this supposed to crash Rainmeter?

kyriakos876 » May 26th, 2018, 7:00 pm

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: 8871
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is this supposed to crash Rainmeter?

balala » May 26th, 2018, 7:07 pm

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.