It is currently May 7th, 2024, 5:48 am

Monthly Wallpapers?

Get help with creating, editing & fixing problems with skins
cornycapybara84
Posts: 6
Joined: February 24th, 2012, 11:10 pm

Monthly Wallpapers?

Post by cornycapybara84 »

I am trying to make a skin that has a set Image as a background depending on the month. The images are named as the month they belong to. This is my first attempt at making a skin and I'm pretty sure i used things incorrectly a lot. When I set the image name correctly it does work though, so I'm pretty sure its the MeasureCalc section that is bad.

Code: Select all

[VARIABLES]
IMG=Janua  ;default is spelled wrong so i can see if fixed on refresh (nothing displayed if broken)
MoNTH=01   ;Default


[Rainmeter]
Author=CornyCapybara84
Version=1
Update=1000


[MeterBackground]
Meter=Image
ImageName=#IMG#
X=0
Y=0
;Set width and height to screen resolution
W=1366
H=768



;[Tab] future code

[MeasureCalc]
Measure=Calc
;below is trying to make it so that if the current walpaper is a month behind, it updates, otherwise it remains the same
Formula=(%m-1) = #MoNTH# ? !Execute [!SetOption VARIABLES IMG %B][!SetOption VARIABLES MoNTH %m] : !Execute [!SetOption VARIABLES IMG %B]
Please help if you can, I will continue messing with it on my own and will share if I fix it.
Last edited by cornycapybara84 on February 25th, 2012, 9:28 pm, edited 1 time in total.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Monthly Wallpapers

Post by smurfier »

This has not been tested. I simply corrected the visible errors in your code.

Code: Select all

[VARIABLES]
IMG=Janua  ;default is spelled wrong so i can see if fixed on refresh (nothing displayed if broken)
MoNTH=1   ;Default

[Rainmeter]
Author=CornyCapybara84
Version=1
Update=1000

[MeterBackground]
Meter=Image
ImageName=#IMG#
X=0
Y=0
;Set width and height to screen resolution
W=1366
H=768

[MonthNum]
Measure=Time
Format=%#m

[MonthName]
Measure=Time
Format=%B

[MeasureCalc]
Measure=Calc
Formula=(MonthNum-1)=#MoNTH#
IfAboveValue=0
IfAboveAction=!Execute [!SetVariable IMG [MonthName]][!SetVariable MoNTH [MonthNum]]
IfBelowValue=1
IfBelowAction=!SetVariable IMG [MonthName]
DynamicVariables=1
  • Time codes must be used with a Time measure.
  • SetOption changes the options of a Meter/Measure. To change a variable use the SetVariable bang.
  • Use the IfActions to execute bangs in conjunction with measures.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: Monthly Wallpapers

Post by AlC »

Hey cornycapybara84

I did it with the new !Setwallpaper bang and it worked for February

Code: Select all

[Rainmeter]
Update=1000

[Variables]
ext=jpg

[mMonth]
Measure=Time
Format=%#m

[Meter]
Meter=Image

[cCalc]
Measure=Calc
Formula=(cCalc+1)
IfAboveValue=3
IfAboveAction=!Execute [!SetWallpaper #CURRENTPATH#[mMonth].#ext# STRETCH][!DisableMeasure cCalc]
like smurfier said, it's hard to test :)

here is a example skin to test

Code: Select all

[Rainmeter]
Update=1000

[Variables]
ext=jpg

[Meter]
Meter=Image
SolidColor=255,0,0
X=300
Y=300
W=100
H=100
LeftMouseUpAction=!SetWallpaper #CURRENTPATH#[mMonth].#ext# STRETCH
LeftMouseDownAction=!UpdateMeasure mMonth

[mMonth]
Measure=Calc
Formula=mMonth%12+1
UpdateDivider=-1
Just click on the red image to test.

NOTE:
- Update Rainmeter to the latest version !!!
- Choose Position parameter for the Wallpaper here ... STRETCH FIT FILL ?
- Have 12 pictures (for each month) in your folder and name it 1.jpg (for January) ... 12.jpg (for December)
- The pictures must have all the same file type, example jpg or png. And change it in the variables under "ext"
If the pictures are different file types you can open it wth paint and save as an other file type
Last edited by AlC on February 25th, 2012, 12:30 am, edited 1 time in total.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Monthly Wallpapers?

Post by smurfier »

ALC,

If you change your calc to the code below it will provide a number from 1 thru 12 instead of 0 thru 11.

Code: Select all

[mMonth]
Measure=Calc
Formula=mMonth%12+1
UpdateDivider=-1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: Monthly Wallpapers?

Post by AlC »

smurfier wrote:ALC,

If you change your calc to the code below it will provide a number from 1 thru 12 instead of 0 thru 11.

Code:
[mMonth]
Measure=Calc
Formula=mMonth%12+1
UpdateDivider=-1
O.O
the smiley says it all.
Thank you for the tip Counter-Guru :)
Rainmeter - You are only limited by your imagination and creativity.
cornycapybara84
Posts: 6
Joined: February 24th, 2012, 11:10 pm

Re: Monthly Wallpapers?

Post by cornycapybara84 »

Thanks to both of you. It still isnt working, but you both helped sort out some code issues. Smurfier, can you explain the MeasureCalc piece to me
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Monthly Wallpapers?

Post by smurfier »

Code: Select all

[MeasureCalc]
Measure=Calc
Formula=(MonthNum-1)=#MoNTH#
IfAboveValue=0
IfAboveAction=!Execute [!SetVariable IMG [MonthName]][!SetVariable MoNTH [MonthNum]]
IfBelowValue=1
IfBelowAction=!SetVariable IMG [MonthName]
DynamicVariables=1
  • Conditional statements evaluate to 1 (true) or 0 (false). This allows us to use them like numbers.
  • MonthNum retrieves the value of the MonthNum measure, no need to use DynamicVariables here.
  • In order to have the measure fire actions we need to implement IfActions. Since the measure outputs only two values it's rather easy.
  • We need to activate and use DynamicVariables on our measure in order to use the MonthName and MonthNum measures outside of the Formula line (we used them in the IfActions).
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
cornycapybara84
Posts: 6
Joined: February 24th, 2012, 11:10 pm

Re: Monthly Wallpapers?

Post by cornycapybara84 »

So I have it so it only shows June right now... i cant figure out what to do to the measureCalc measure to make it so that it will update the variables correctly. Any help would be greatly appreciated, even if it means scrapping all my code b/c its inneficient
You do not have the required permissions to view the files attached to this post.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Monthly Wallpapers?

Post by smurfier »

Let's just do this the easy way:

Code: Select all

[Rainmeter]
Author=CornyCapybara84
Update=1000

[MetaData]
Version=2

[MonthName]
Measure=Time
Format=%B

[MeterBackground]
Meter=Image
MeasureName=MonthName
W=1366
H=768
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
cornycapybara84
Posts: 6
Joined: February 24th, 2012, 11:10 pm

Re: Monthly Wallpapers?

Post by cornycapybara84 »

You are a genius! how can it be this simple?