balala wrote: ↑September 12th, 2023, 5:56 pm
I can't follow what is your intention. What you mean by "time left"? Also, as far as I can tell, a looping timer can't have randomized values. A looping timer counts (or counts down) continuously, doesn't return random values. If you want such a counter which counts back (or counts up) from certain value to 0 (or vice-versa), than continuously restarts the countdown / count, your code is way too complicated. Not sure why have you set a Calc measure using a Random function ([MeasureRandom]), especially not one having the same LowBound and HighBound values (this measure is returning a constant value, 10). Also not sure why did you use another Calc measure ([MeasureCountdown] in this case), which has a well-defined formula (which extracts the Counter operator from the value of the [MeasureRandom] measure, which has a constant value), but which is modified by the IfTrueAction4 option of the [MeasurePercentLeft] measure.
So give us please a few precise
details on what you want to achieve.
There are a few other inadvertences into your code (for instance a duplicated [Rainmeter] section), but these will be fixed later. First I'd like to understand your intention.
Okay, so, I have the lowbound and highbound values set to 10 because I was doing trial and error with the IfTrueAction4 option and didn't want to wait longer for the timer to hit 0. I would usually have it be set between 60 and 360 so it would randomly set a timer between 1 and 6 minutes. The other IfTrueActions would set the color of the MeterText depending on the percentage left (so it'd turn yellow at 30 seconds if the timer was 1 minute, or 60 seconds if the timer was 2 minutes). I'm trying to get the timer to reset back to its original, 100% starting value after it hits zero.
You can run the code with changed LowBound and HighBound values in order to make the timer random, I just had them set at 10 so I could experiment easily with the IfTrueAction4 option.
Edit: Also, just set IfTrueAction4 to be blank so you can see what I mean. It keeps counting down into the negatives when I want it to start back up again at 100%.
Code: Select all
;go from this
IfTrueAction4=[!SetOption MeasureCountdown Formula "(MeasureRandom - Counter + Random)"]
To be more specific, I'm trying to get the timer to reset back to the original value created by [MeasureRandom]. I can't reset the skin without setting a timer of a different value, and I don't know how to set a Counter back to zero without resetting the skin. I want the [MeasureRandom] value to be random upon booting up the skin but I want the timer itself to loop that random timer every time it reaches zero.
So, if MeasureRandom returned a value of 180, it'd just loop a 3-minute timer indefinitely until I close it, but if it returned a value of 300 it'd loop a 5-minute timer indefinitely until I close it.