It is currently April 24th, 2024, 3:06 pm

a scrolling ticker

Tips and Tricks from the Rainmeter Community
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

a scrolling ticker

Post by moshi »

here's a way to scroll text using substitutions and !SetVariable:

Code: Select all

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

[Variables]
AudioPlayer=winamp
Text=

[MeasureAudioPlayerTitle]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=#AudioPlayer#
PlayerType=Title
Substitute="":" this is a scrolling ticker. you better use a monospaced font."
OnChangeAction=[!SetVariable Text " [MeasureAudioPlayerArtist][MeasureAudioPlayerTitle]"]

[MeasureAudioPlayerArtist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[MeasureAudioPlayerTitle]
PlayerType=Artist
RegExpSubstitute=1
Substitute="^(.+)$":"\1 - "

[Calc1]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#Text#","^.(.*)$":"\1"
OnUpdateAction=[!SetVariable Text "[Calc1]"]

[Calc2]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#Text#","^(...................).*$":"\1"

[Calc3]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#Text#","^(.+)$":"1","^$":"0"

[Calc4]
Measure=Calc
Formula=([Calc3])
DynamicVariables=1
IfEqualValue=0
IfEqualAction=[!SetVariable Text " [MeasureAudioPlayerArtist][MeasureAudioPlayerTitle]"]

[MeterTitle]
Meter=String
Text="[Calc2]"
FontColor=ffffff
FontSize=20
FontFace=Consolas
DynamicVariables=1
Antialias=1
StringStyle=Bold
SolidColor=00000001
User avatar
Dank420
Posts: 145
Joined: April 3rd, 2013, 1:04 am
Location: O-High-O

Re: a scrolling ticker

Post by Dank420 »

id thought about this(but dont have the skill) love it...
shaved 5 to 8% off cpu useing this instead of Scrolling marquee lua
and speed changeable with update .. BUEATY.....
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: a scrolling ticker

Post by moshi »

you could also try this:

Code: Select all

[Calc2]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#Text# [MeasureAudioPlayerArtist][MeasureAudioPlayerTitle]","^(...................).*$":"\1"
User avatar
iNjUST
Posts: 117
Joined: June 20th, 2012, 12:44 am

Re: a scrolling ticker

Post by iNjUST »

Very cool, thanks for the tip!

Not to steal your thunder, but here's a slightly optimized version:

Code: Select all

[Rainmeter]
Update=200

[Variables]
; Initial Text (modify based on your Measures and preferences)
InitText="[mTitle] by [mArtist] from [mAlbum]"
; Set the Ticker Text to the initial value to begin
TickText=#InitText#
; Text between repetitions of the ticker
GapText="........."
; Number of characters to display
NumChar=16

[mTitle]
; I won't include all of this.
[mArtist]
; Use the NowPlaying doc page...
[mAlbum]
; if you don't know what this is.

[cText1]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#TickText#","^.(.*)$":"\1","^$":"#GapText# #InitText#"
OnUpdateAction=[!SetVariable TickText "[cText1]"]

[cText2]
Measure=Calc
Formula=1
DynamicVariables=1
RegExpSubstitute=1
Substitute="1":"#TickText# #GapText# #InitText#","^(.{#NumChar#}).*$":"\1"

I'll be using this in an upcoming skin, so I'll give you some credit when I post it for the initial idea!