It is currently March 29th, 2024, 9:13 am

Help whit 7 DAYS WEATHER by adni18

Get help with creating, editing & fixing problems with skins
mandy1985
Posts: 5
Joined: September 15th, 2019, 10:18 pm

Help whit 7 DAYS WEATHER by adni18

Post by mandy1985 »

Hi,
I am using this skins, which I like very much, but I would like it to be placed over all windows from time to time and after 1 or 2 minutes it was put back into normal mode.
Is this possible?
Could someone help me?
Thanks
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help whit 7 DAYS WEATHER by adni18

Post by eclectic-tech »

EDIT:

{Reply removed...}

I totally missed his point...
See balala's solution below :great:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help whit 7 DAYS WEATHER by adni18

Post by balala »

mandy1985 wrote: September 15th, 2019, 10:23 pm but I would like it to be placed over all windows from time to time and after 1 or 2 minutes it was put back into normal mode.
Beside eclectic-tech's reply, what do you mean by "from time to time"?
For instance if you add the following measure to your code:

Code: Select all

[MeasureTime]
Measure=Time
Format=%M
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!ZPos "2"]
IfFalseAction=[!ZPos "0"]
you'll get the skin over all windows on every hour, for one minute, then it will go back to the normal state.
mandy1985
Posts: 5
Joined: September 15th, 2019, 10:18 pm

Re: Help whit 7 DAYS WEATHER by adni18

Post by mandy1985 »

balala wrote: September 16th, 2019, 2:46 pm Beside eclectic-tech's reply, what do you mean by "from time to time"?
For instance if you add the following measure to your code:

Code: Select all

[MeasureTime]
Measure=Time
Format=%M
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!ZPos "2"]
IfFalseAction=[!ZPos "0"]
you'll get the skin over all windows on every hour, for one minute, then it will go back to the normal state.
Thanks very much balala,
I means for example:
every x minutes or hours the widget is placed above all windows for a short o long time if it can be defined, better then.
after that time the widget return to normal mode or below the other windows.
Thanks for your support, then the configuration file:
7 DAYS WEATHER by adni18.ini
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help whit 7 DAYS WEATHER by adni18

Post by jsmorley »

mandy1985 wrote: September 19th, 2019, 11:43 am Thanks very much balala,
I means for example:
every x minutes or hours the widget is placed above all windows for a short o long time if it can be defined, better then.
after that time the widget return to normal mode or below the other windows.
Thanks for your support, then the configuration file:
7 DAYS WEATHER by adni18.ini
I would look at adding something like this:

Code: Select all

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

[Variables]
; Timers are in Seconds
StartTimer=30
EndTimer=10

[MeasureCounter]
Measure=Calc
Formula=Counter % #StartTimer#
IfCondition=MeasureCounter = 0
IfTrueAction=[!SetOption MeterString FontColor "0,255,0,255"][!UpdateMeter MeterString][!Redraw]
IfCondition2=MeasureCounter=#EndTimer#
IfTrueAction2=[!SetOption MeterString FontColor "255,255,255,255"][!UpdateMeter MeterString][!Redraw]

[MeterString]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
In this example this will turn the text red when the counter reaches 0, which will be when the skin is first loaded, and every 30 (StartTimer) seconds thereafter.

Then when the counter reaches 10 (EndTimer), ten seconds later, it will change the text back to white.

So in short, it will change the text color to red every 30 seconds, for 10 seconds.

You can change IfCondition=MeasureCounter = 0 to IfCondition=MeasureCounter = #StartTimer# if you prefer that the action take place at the "end" of the counting cycle instead of the "beginning". Just means the action won't fire when the skin is first loaded, but only after #StartTimer# seconds.

https://docs.rainmeter.net/manual/measures/calc/#Formulas

While modulus (remainder) math takes a second to wrap your head around, the long and the short of it is that if you say Counter % SomeValue, then Counter will start at 0, and increase by 1 each skin update. When Counter can be divided evenly (no remainder) by SomeValue, the measure's value will reset to 0 and start over. To be technically accurate, since the value 0 is included in the mix, if SomeValue is 10, it will actually happen every 11 skin updates (presumably seconds), so keep that in mind if some very specific amount of time is desired. You might use Counter % (StartValue -1) in that case.

You can use !ZPos bangs instead of the font color in my example, as you like.

I would be tempted to not use Time measures to control this, as you aren't asking that something happen at a particular "time" but on some "timed basis". It's more of a "timer" and less of an "alarm clock" if you see what I mean. The internal Counter function is particularly useful for this, and simpler than setting up one or two or even three Time measures to evaluate the time of day.

It is particularly challenging, and not worth the effort, to use Time measures to say something like "every 13 minutes" for instance. When it could simply be Formula=Counter % 780.

If on the other hand, you had expressed this as "take some action on the hour, or on the half hour", rather than "take some action every 60 minutes, or every 30 minutes", then the Time measure would be useful.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help whit 7 DAYS WEATHER by adni18

Post by balala »

mandy1985 wrote: September 19th, 2019, 11:43 am then the configuration file:
Does it work as expected? I hope it does.
mandy1985 wrote: September 19th, 2019, 11:43 am every x minutes or hours the widget is placed above all windows for a short o long time if it can be defined, better then.
after that time the widget return to normal mode or below the other windows.
To can set the length of the time while the skin is placed above the windows, modify the [MeasureTime] measure as it follows:

Code: Select all

[MeasureTime]
Measure=Time
Format=%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=(Clamp((#Start#+#Length#),0,59))))
IfTrueAction=[!ZPos "2"]
IfFalseAction=[!ZPos "0"]
In this case, setting the skin as intended will happen when the minutes are equal with the value of the Start variable, then when the minutes are equal with Start+Length, the skin is set back to normal.
This will work if you define the two needed variables in the [Variables] section. For instance:

Code: Select all

[Variables]
...
Start=0
Length=20
With these variables, the skin is set to stay topmost every hour, (due to the Start=0 variable) and will be set back to normal after 20 minutes (due to the Length=20 value).
Take care this will work only if the Start+Length is greater then Start. For instance with this method if Start is set to 50 and Length to 20, the setting won't work.
If this is also needed please let me know to modify the code appropriately.
mandy1985
Posts: 5
Joined: September 15th, 2019, 10:18 pm

Re: Help whit 7 DAYS WEATHER by adni18

Post by mandy1985 »

balala wrote: September 19th, 2019, 4:13 pm Does it work as expected? I hope it does.

To can set the length of the time while the skin is placed above the windows, modify the [MeasureTime] measure as it follows:

Code: Select all

[MeasureTime]
Measure=Time
Format=%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=(Clamp((#Start#+#Length#),0,59))))
IfTrueAction=[!ZPos "2"]
IfFalseAction=[!ZPos "0"]
In this case, setting the skin as intended will happen when the minutes are equal with the value of the Start variable, then when the minutes are equal with Start+Length, the skin is set back to normal.
This will work if you define the two needed variables in the [Variables] section. For instance:

Code: Select all

[Variables]
...
Start=0
Length=20
With these variables, the skin is set to stay topmost every hour, (due to the Start=0 variable) and will be set back to normal after 20 minutes (due to the Length=20 value).
Take care this will work only if the Start+Length is greater then Start. For instance with this method if Start is set to 50 and Length to 20, the setting won't work.
If this is also needed please let me know to modify the code appropriately.
Hi balala,
i get this error:
ERRO (15:49:05.620) 7 DAYS WEATHER\7 DAYS WEATHER by adni18.ini - [MeasureTime]: Syntax error: IfCondition=((MeasureTime>=#Start#)&&(MeasureTime<=(Clamp((#Start#+#Length#),0,59))))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help whit 7 DAYS WEATHER by adni18

Post by balala »

mandy1985 wrote: September 19th, 2019, 7:51 pm Hi balala,
i get this error:
ERRO (15:49:05.620) 7 DAYS WEATHER\7 DAYS WEATHER by adni18.ini - [MeasureTime]: Syntax error: IfCondition=((MeasureTime>=#Start#)&&(MeasureTime<=(Clamp((#Start#+#Length#),0,59))))
I suppose you've forgot to add the Start and Length variables to the [Variables] section. Please make sure you have them there. If you have them, is the error message still present?
mandy1985
Posts: 5
Joined: September 15th, 2019, 10:18 pm

Re: Help whit 7 DAYS WEATHER by adni18

Post by mandy1985 »

balala wrote: September 19th, 2019, 7:59 pm I suppose you've forgot to add the Start and Length variables to the [Variables] section. Please make sure you have them there. If you have them, is the error message still present?
Yes man, the same error look the image
Sin título.png
You do not have the required permissions to view the files attached to this post.
mandy1985
Posts: 5
Joined: September 15th, 2019, 10:18 pm

Re: Help whit 7 DAYS WEATHER by adni18

Post by mandy1985 »

@balala, I was thinking and searching in the forum, the ability to do it using commands in windows cmd.
for example:
C:\Program Files\Rainmeter\Rainmeter.exe !ZPos "2" NUXHD\Weather
This line should put the widget on top of all windows, according to https://docs.rainmeter.net/manual/bangs/#OS,
but it does not work for me, and neither gives me error.
Do you know any of that in which you could help me?
Thanks very much