It is currently March 29th, 2024, 8:43 am

Changing text and blinking text

Get help with creating, editing & fixing problems with skins
andrewisbest69
Posts: 5
Joined: November 3rd, 2019, 6:06 pm

Changing text and blinking text

Post by andrewisbest69 »

Hi guys, im really not that good with rainmeter, in fact im a noob. I want to do something like change one string to like 4 different texts and then repeat it and repeat it and so on. Something like train information board and the string will be witch stations the train goes through. And also a string, that will be the train departure time, and when I click the string, it will start blinking, like the train is leaving the station. Trying to send a sample.

Code: Select all

[MeterStations]
Meter=String
MeasureName=MeasureDate
X=126
Y=27
FontColor=255,255,255,255
FontFace=CD Fedra Medium
FontSize=14
FontEffectColor=0,0,0,255
AntiAlias=1
;I want this string to change to 4 different texts, one change per 3 seconds:
;Wien hbf - via Hanau hbf.
;Wien hbf - via Regensburg hbf.
;Wien hbf - via Plattling
;Wien hbf - via Linz hbf.
Text=Wien hbf - via CHANGING TEXT

[MeterDeparture]
Meter=String
MeasureName=MeasureDate
X=450
Y=24
FontColor=255,255,255,255
FontFace=CD Fedra Medium
FontSize=18
FontEffectColor=0,0,0,255
AntiAlias=1
;I want this string to blink when I click it
Text=17:43
Image
Last edited by andrewisbest69 on November 4th, 2019, 4:57 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Changing text and blinking text

Post by balala »

andrewisbest69 wrote: November 3rd, 2019, 6:45 pm Hi guys, im really not that good with rainmeter, in fact im a noob. I want to do something like change one string to like 4 different texts and then repeat it and repeat it and so on. Something like train information board and the string will be witch stations the train goes through. And also a string, that will be the train departure time, and when I click the string, it will start blinking, like the train is leaving the station. Trying to send a sample.
Do you have a starting code? Something to start with. I suppose you'll acquire those information from the web, right? Do you have that code? Would be much simpler to help.
andrewisbest69
Posts: 5
Joined: November 3rd, 2019, 6:06 pm

Re: Changing text and blinking text

Post by andrewisbest69 »

Ok, I will post some tomorrow, it's 10pm for me now
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Changing text and blinking text

Post by balala »

andrewisbest69 wrote: November 3rd, 2019, 8:43 pm Ok, I will post some tomorrow, it's 10pm for me now
For me it's almost 11PM (EET). However I wait for that code.
andrewisbest69
Posts: 5
Joined: November 3rd, 2019, 6:06 pm

Re: Changing text and blinking text

Post by andrewisbest69 »

My whole working skin code:

Code: Select all

[MeterStations]
Meter=String
MeasureName=MeasureDate
X=126
Y=27
FontColor=255,255,255,255
FontFace=CD Fedra Medium
FontSize=14
FontEffectColor=0,0,0,255
AntiAlias=1
;I want this string to change to 4 different texts, one change per 3 seconds:
;Wien hbf - via Hanau hbf.
;Wien hbf - via Regensburg hbf.
;Wien hbf - via Plattling
;Wien hbf - via Linz hbf.
Text=Wien hbf - via CHANGING TEXT

[MeterDeparture]
Meter=String
MeasureName=MeasureDate
X=450
Y=24
FontColor=255,255,255,255
FontFace=CD Fedra Medium
FontSize=18
FontEffectColor=0,0,0,255
AntiAlias=1
;I want this string to blink when I click it
Text=17:43
Last edited by balala on November 4th, 2019, 5:01 pm, edited 2 times in total.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
andrewisbest69
Posts: 5
Joined: November 3rd, 2019, 6:06 pm

Re: Changing text and blinking text

Post by andrewisbest69 »

balala wrote: November 3rd, 2019, 8:48 pm For me it's almost 11PM (EET). However I wait for that code.
Sent the code. Can u help me now?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Changing text and blinking text

Post by balala »

andrewisbest69 wrote: November 4th, 2019, 4:23 pm Sent the code. Can u help me now?
Yes, I suppose I can. Here is it:
Add the UpdateStations variable into the [Variables] section:

Code: Select all

[Variables]
UpdateStations=3
This will be the update period of changing the texts (supposing the Update value within the [Rainmeter] section is set to the default Update=1000) of the [MeterStations] meter (which will return either Wien hbf - via Hanau hbf., Wien hbf - via Regensburg hbf., Wien hbf - via Plattling or Wien hbf - via Linz hbf.). If needed, you can use any value.
Add the following two measures to your code:

Code: Select all

[MeasureStations]
Measure=Calc
Formula=(( #CURRENTSECTION# + 1 ) % 4 )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterStations Text "Wien hbf - via Hanau hbf."][!UpdateMeter "MeterStations"][!Redraw]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!SetOption MeterStations Text "Wien hbf - via Regensburg hbf."][!UpdateMeter "MeterStations"][!Redraw]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!SetOption MeterStations Text "Wien hbf - via Plattling"][!UpdateMeter "MeterStations"][!Redraw]
IfCondition4=(#CURRENTSECTION#=3)
IfTrueAction4=[!SetOption MeterStations Text "Wien hbf - via Linz hbf."][!UpdateMeter "MeterStations"][!Redraw]
UpdateDivider=#UpdateStations#

[MeasureBlinking]
Measure=Calc
formula=( COUNTER % 2 )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "MeterDeparture"][!Redraw]
IfFalseAction=[!ShowMeter "MeterDeparture"][!Redraw]
Paused=1
The first of these two measures ([MeasureStations]) is setting the station name, while the second one ([MeasureBlinking]) is blinking the [MeterDeparture] meter.
Since the Text option of the [MeterStations] meter is set through the !SetOption bangs of the [MeasureStations] measure, you can get rid of Text option of the [MeterStations] meter (remove it).
See that the [MeasureBlinking] measure is paused at the beginning (due to its Paused=1 option), so the [MeterDeparture] meter doesn't blink. If you add a LeftMouseUpAction=[!TogglePauseMeasure "MeasureBlinking"] option to the [MeterDeparture] meter, you can start blinking it through a click onto it (then on every following click it will stop / start blinking again).
Is this what you wanted?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing text and blinking text

Post by eclectic-tech »

andrewisbest69 wrote: November 4th, 2019, 4:23 pm Sent the code. Can u help me now?
Removed suggestion, since Balala already offered help...
andrewisbest69
Posts: 5
Joined: November 3rd, 2019, 6:06 pm

Re: Changing text and blinking text

Post by andrewisbest69 »

balala wrote: November 4th, 2019, 6:48 pm Yes, I suppose I can. Here is it:
Add the UpdateStations variable into the [Variables] section:

Code: Select all

[Variables]
UpdateStations=3
This will be the update period of changing the texts (supposing the Update value within the [Rainmeter] section is set to the default Update=1000) of the [MeterStations] meter (which will return either Wien hbf - via Hanau hbf., Wien hbf - via Regensburg hbf., Wien hbf - via Plattling or Wien hbf - via Linz hbf.). If needed, you can use any value.
Add the following two measures to your code:

Code: Select all

[MeasureStations]
Measure=Calc
Formula=(( #CURRENTSECTION# + 1 ) % 4 )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption MeterStations Text "Wien hbf - via Hanau hbf."][!UpdateMeter "MeterStations"][!Redraw]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!SetOption MeterStations Text "Wien hbf - via Regensburg hbf."][!UpdateMeter "MeterStations"][!Redraw]
IfCondition3=(#CURRENTSECTION#=2)
IfTrueAction3=[!SetOption MeterStations Text "Wien hbf - via Plattling"][!UpdateMeter "MeterStations"][!Redraw]
IfCondition4=(#CURRENTSECTION#=3)
IfTrueAction4=[!SetOption MeterStations Text "Wien hbf - via Linz hbf."][!UpdateMeter "MeterStations"][!Redraw]
UpdateDivider=#UpdateStations#

[MeasureBlinking]
Measure=Calc
formula=( COUNTER % 2 )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "MeterDeparture"][!Redraw]
IfFalseAction=[!ShowMeter "MeterDeparture"][!Redraw]
Paused=1
The first of these two measures ([MeasureStations]) is setting the station name, while the second one ([MeasureBlinking]) is blinking the [MeterDeparture] meter.
Since the Text option of the [MeterStations] meter is set through the !SetOption bangs of the [MeasureStations] measure, you can get rid of Text option of the [MeterStations] meter (remove it).
See that the [MeasureBlinking] measure is paused at the beginning (due to its Paused=1 option), so the [MeterDeparture] meter doesn't blink. If you add a LeftMouseUpAction=[!TogglePauseMeasure "MeasureBlinking"] option to the [MeterDeparture] meter, you can start blinking it through a click onto it (then on every following click it will stop / start blinking again).
Is this what you wanted?
Thank you very much, works perfectly! :D
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Changing text and blinking text

Post by balala »

andrewisbest69 wrote: November 4th, 2019, 7:15 pm Thank you very much, works perfectly! :D
I'm glad.