It is currently April 24th, 2024, 9:36 pm

Begin with Loop inactive?

Get help with creating, editing & fixing problems with skins
User avatar
Ryn
Posts: 18
Joined: May 7th, 2020, 8:11 am

Begin with Loop inactive?

Post by Ryn »

Hi, I was wondering, is there a way to have a loop be inactive upon launching the skin?

Code: Select all

[LoopTimer1]
Measure=Loop
StartValue=0
EndValue=(#LevelTime#+1)
LoopCount=1
DynamicVariables=1
IfCondition=LoopTimer1>=#LevelTime#
IfTrueAction=[!SetVariable Program1Level (#Program1Level#+1)][!WriteKeyValue Variables Program1Level "#Program1Level#" "#@#Level.inc"]
I want to make it so this only runs when I hit the button, but right now it runs as soon as the program starts.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Begin with Loop inactive?

Post by balala »

Ryn wrote: May 27th, 2020, 3:46 am Hi, I was wondering, is there a way to have a loop be inactive upon launching the skin?
Yep, there actually is. Just add a Disabled=1 option to the measure.
User avatar
Ryn
Posts: 18
Joined: May 7th, 2020, 8:11 am

Re: Begin with Loop inactive?

Post by Ryn »

Awesome thanks!
I ended up using paused=1 to do it since it suits the function better.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Begin with Loop inactive?

Post by balala »

Ryn wrote: May 27th, 2020, 6:39 am I ended up using paused=1 to do it since it suits the function better.
Yep, that's another solution, however there is a difference between disabling and pausing the measure.
If the measure is disabled, its numerical value is 0, while if it's paused it keeps its value, but that's not incremented. For instance if the StartValue is set to another value than 0, if you disable the measure, its value is 0, while if you pause it, the value it gets is the StartValue.
User avatar
Ryn
Posts: 18
Joined: May 7th, 2020, 8:11 am

Re: Begin with Loop inactive?

Post by Ryn »

Im glad I paused it then instead of disabling. The system shouldn't reset to 0 every time I start and stop it.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Begin with Loop inactive?

Post by balala »

Ryn wrote: May 27th, 2020, 8:36 am Im glad I paused it then instead of disabling. The system shouldn't reset to 0 every time I start and stop it.
Yep, this is an advantage of pausing, instead of disabling it. Good work.