I have written a Lua script that will marquee a single line of text.
*** Rainmeter 2.5 or higher required ***
Inputs:
Text*
Predefined Text.
MeasureName
The name of a measure.
Variable
The name of a variable.
Options:
Width*
The width of the marquee. This number represents characters, not pixels.
Defaults to 10
Delimiter*
The delimiter between items. Quotes or Apostrophes must be used around spaces, and escaped with / if you want them included in the delimiter. Only used when using multiple measures.
Defaults to ' '
ForceScroll*
When set to 1, forces a string that is shorter than Width to scroll.
Pause
Used to set the default state of the Pause variable. 0 for paused, 1 for scrolling.
Position
When set to LEFT, the string starts on the left side of the marquee.
*These options are compatible with DynamicVariables.
Notes
To use multiple inputs of the same type, simply use a pipe delimiter between names. This does no apply to the Text input.
Example: MeasureName=Measure1|OtherMeasure
More than one type of input may be used and are displayed in the following order:
Measures, Variables, Text.
If no input is specified or if no information is retireved, "Input Error!" is displayed.
If the length of the text is less than the specified width, the text will not scroll.
Actions:
Reset the Timer
!CommandMeasure "MeasureLua" "Timer=0;"
Pause
!CommandMeasure "MeasureLua" "Pause=0;"
UnPause
!CommandMeasure "MeasureLua" "Pause=1;"
Toggle Pause
!CommandMeasure "MeasureLua" "Pause=1-Pause"
Tricks:
Have the text scroll only on mouseover.
On the Marquee measure set Pause=0 and Position=Left.
On the meter in question set: MouseOverAction=!CommandMeasure Lua Pause=1 MouseLeaveAction=!CommandMeasure Lua Pause,Timer=0,0
Since the width of the marquee is defined in characters instead of pixels it is best to use a MonoSpace font.
My choice of font is Monospace Typewriter.
LuaMarquee_6.2.rmskin
Changelog:
EDIT:
Updated to take values from one of three different fields.
EDIT2:
Updated to make the string fill the defined width. Also fixed one line of code
EDIT3:
Update to make use of multiple measures and allow for definition of delimiters.
EDIT4:
Updated so that the text scrolls from left to right without repeating the text. Also added ScrollMode=2 to prevent the text from scrolling when it is smaller than the defined width.
EDIT5: (v5.0)
Updated to add AutoRefresh. Also some small code revisions.
11/30/2011: (v5.3)
Updated to remove NumOfMeasures and general updates to the script.
12/1/2011: (v5.4)
Updated to allow multiple Variables and added support for the use of multiple input types. Minor code optimizations. Removed TogglePause function.
12/2/2011: (v5.5)
Removed ScrollMode, AutoReset, and StartPosition. Minor code optimizations.
12/26/2011:
v5.6- Minor code optimizations.
v5.7- Added ForceScroll.
3/11/2012: (v6.0)
-Updated to use current Rainmeter standards.
-Added Pause option for setting default state.
9/8/2012: (v6.0)
-Fixed bug typo.
5/20/2013: (v6.2)
-Fixed several issues.
You do not have the required permissions to view the files attached to this post.
Last edited by smurfier on August 5th, 2011, 1:36 am, edited 21 times in total.
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 . . .
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 . . .
of the lua script with 3 measure names and change the NumofMeasures to 3. I think I am not understanding your reply Currently I get "the [MeterTrack] cannot be bound with [MeasureLua1]!" etc using this in the copy of the skin:
Seahorse wrote:
of the lua script with 3 measure names and change the NumofMeasures to 3. I think I am not understanding your reply Currently I get "the [MeterTrack] cannot be bound with [MeasureLua1]!" etc using this in the copy of the skin:
I'll take a look in the morning. It's working perfectly for me with WebParser.
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 . . .
I am having no problem using NowPlaying with this method.
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 . . .
"the [MeterTrack] cannot be bound with [MeasureLua1]" error is because I have measures in the string meters, which I think I don't need at all a lua forces the text in there somehow I seem to recall. So that's that one removed.
So just so I am clear on this, as I am no doubt misunderstanding something
I need to make no change to the lua script as this is 3 measure/meters?
Then the three string meters listed above just need to be added to the skin and we should be ok having ditched the Text=%1 in all three instances as the lua script pumps it into them
This is the third of the three, but Rainmeter's "About" shows no value for any of them, so I'm edging forward, but still not quite there.
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 . . .
function Update()
if PROPERTIES.Text ~= "" then
Text = PROPERTIES.Text..PROPERTIES.Delimiter
elseif PROPERTIES.MeasureName ~= "" then
if iMeasureCount > 1 then
Text = tMeasures[1]:GetStringValue()..PROPERTIES.Delimiter
for i=2, iMeasureCount do
Text = Text..tMeasures[i]:GetStringValue()..PROPERTIES.Delimiter
end
else
Text = Measure:GetStringValue()..PROPERTIES.Delimiter
end
else
Text = SKIN:ReplaceVariables("#"..PROPERTIES.Variable.."#")..PROPERTIES.Delimiter
end
Be VERY specific with what you ask for.
The more specific you are, the higher the quality of support you receive.
Do not just copy and paste what I put in examples and come back saying it doesn't work.
It does work, but I purposely left blanks that you need to fill for your specific needs.