It is currently April 27th, 2024, 8:29 pm

Help with syncing Marquee.lua script for multiple texts.

Get help with creating, editing & fixing problems with skins
User avatar
Harkeerat16
Posts: 15
Joined: June 10th, 2017, 10:54 am
Location: India

Help with syncing Marquee.lua script for multiple texts.

Post by Harkeerat16 »

Hi! I have been using Marquee.lua script made by smurfier and later modified by Skymil posted here: https://forum.rainmeter.net/viewtopic.php?f=99&t=9015&start=70.
I'm using it to Marquee song title/artist names that are too long. The problem is that it doesn't stay in sync. Like I would want the song name and artist name to start together. Here are some pictures:
https://imgur.com/a/5Seh3rT
How would I go about doing syncing them?
Thanks!
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with syncing Marquee.lua script for multiple texts.

Post by eclectic-tech »

Harkeerat16 wrote: May 13th, 2021, 8:28 pm Hi! I have been using Marquee.lua script made by smurfier and later modified by Skymil posted here: https://forum.rainmeter.net/viewtopic.php?f=99&t=9015&start=70.
I'm using it to Marquee song title/artist names that are too long. The problem is that it doesn't stay in sync. Like I would want the song name and artist name to start together. Here are some pictures:
https://imgur.com/a/5Seh3rT
How would I go about doing syncing them?
Thanks!
Can you post the code for your skin; you are most likely going to have to modify the 2 strings in order to sync them, so seeing how you have them currently displayed is needed.
User avatar
Harkeerat16
Posts: 15
Joined: June 10th, 2017, 10:54 am
Location: India

Re: Help with syncing Marquee.lua script for multiple texts.

Post by Harkeerat16 »

Sure, here is the code that deals with the String meters and marquee:

Code: Select all

[MeasureLuaTitle]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=22
Variable=Text
MeasureName=MeasureTitle
Delimiter="          "

[StringMeterTitle]
Meter=String
MeasureName=MeasureLuaTitle
X=176
Y=55
H=25
StringStyle=Bold
FontFace=Red Hat Display
FontSize=25
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow

[MeasureLuaArtist]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=25
Variable=Text
MeasureName=MeasureArtist
Delimiter="          "

[StringMeterArtist]
Meter=String
MeasureName=MeasureLuaArtist
X=176
Y=25
FontWeight=550
FontSize=20
H=25
FontFace=Red Hat Display
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow

[MeasureLuaAlbum]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=27
Variable=Text
MeasureName=MeasureAlbum
Delimiter="          "

[StringMeterAlbum]
Meter=String
MeasureName=MeasureLuaAlbum
H=15
X=176
Y=97
StringStyle=Italic
FontSize=20
FontFace=Red Hat Display
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow
Last edited by eclectic-tech on May 14th, 2021, 11:07 am, edited 1 time in total.
Reason: Please use the code tag </> when posting long codes.
User avatar
balala
Rainmeter Sage
Posts: 16181
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with syncing Marquee.lua script for multiple texts.

Post by balala »

Harkeerat16 wrote: May 13th, 2021, 8:28 pm I'm using it to Marquee song title/artist names that are too long.
Thanks!
Sorry, but can't follow. Where and how do you get the title, the artist and the album in your last code? I suppose some suplimentar NowPlaying measures would be needed.
User avatar
Harkeerat16
Posts: 15
Joined: June 10th, 2017, 10:54 am
Location: India

Re: Help with syncing Marquee.lua script for multiple texts.

Post by Harkeerat16 »

Ah yes, I'm syncing it from my last.fm account, which is a website that tracks everything I listen to on multiple apps. They have a pretty stable API that I'm using. I usually use Spotify so I'm using NowPlaying.dll only for the controls. Here's the full code:

Code: Select all

[Rainmeter]
Update=130
DynamicWindowSize=1
ContextTitle=Open Settings Panel
ContextAction=!ActivateConfig "Universal Music Player\Settings"

[Metadata]
Name=Universal Music Player
Author=Harkeerat 
Information=Music Skin which integrates with last.fm
Version=Feb 12, 2016

[Variables]
UserName=keera_lalala

[MeasureInput]
Measure=Plugin
Plugin=InputText
SolidColor=150,150,150,250
FocusDismiss=1
FontFace=Red Hat Display
FontSize=14
Command1=!WriteKeyValue Variables UserName "$UserInput$" "#CURRENTPATH#Universal Music Player - Large.ini"
Command2=!WriteKeyValue Variables UserName "$UserInput$" "#CURRENTPATH#Universal Music Player - Small.ini"
Command3=!Refresh #CURRENTCONFIG#
DefaultValue="Enter last.fm username!"
X=180
Y=135

[MeterWriteKeyValue]
Meter=String
X=180
Y=135
FontSize=15
FontColor=255,255,255,255
AntiAlias=1
Text=#Username#
LeftMouseUpAction=!CommandMeasure "MeasureInput" "ExecuteBatch 1-3"

[MeasureSite]
Measure=Plugin
Plugin=WebParser
UserName=#UserName#
URL=http://ws.audioscrobbler.com/2.0/?api_key=b3d2b170f5393b31cb43146532ef8023&user=#UserName#&method=user.getrecenttracks&limit=3
RegExp=(?siU)<track(.*)>.*<artist mbid="(.*)">(.*)</artist>.*<name>(.*)</name>.*<streamable>(.*)</streamable>.*<mbid>(.*)</mbid>.*<album mbid="(.*)">(.*)</album>.*<url>(.*)</url>.*<image size="(.*)">(.*)</image>.*<image size="(.*)">(.*)</image>.*<image size="(.*)">(.*)</image>.*<image size="(.*)">(.*)</image>(.*)</track>
UpdateRate=200

[MeasureArtist] 
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
Substitute="&apos;":"'","&amp;":"&","&quot;":'"',"":"Click on enter username"

[MeasureTitle] 
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4
Substitute="&apos;":"'","&amp;":"&","&quot;":'"',"":"Enter yours & refresh!"

[MeasureAlbum] 
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=8
Substitute="&apos;":"'","&amp;":"&","":"Click the album cover to see the last.fm page for this song!","&quot;":'"'

[MeasureLink]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=9

[MeasureCover]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=15
Download=1
DownloadFile=Cover.jpg

[MeterBackground]
Meter=Image
SolidColor=20,20,20,1

[ImageMeter]
Meter=Image
W=150
H=150
X=20
Y=20
ImageName=#@#watermark.png
DynamicVariables=1

[MeterImage]
Meter=Image
MeasureName=MeasureCover
W=150
H=150
X=20
Y=20
LeftMouseUpAction=["[MeasureLink]"]
DynamicVariables=1

[MeasureLuaTitle]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=17
Variable=Text
MeasureName=MeasureTitle
Delimiter="          "

[StringMeterTitle]
Meter=String
MeasureName=MeasureLuaTitle
X=176
Y=55
H=25
StringStyle=Bold
FontFace=Red Hat Display
FontSize=25
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow

[MeasureLuaArtist]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=25
Variable=Text
MeasureName=MeasureArtist
Delimiter="          "

[StringMeterArtist]
Meter=String
MeasureName=MeasureLuaArtist
X=176
Y=25
FontWeight=550
FontSize=18
H=25
FontFace=Red Hat Display
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow

[MeasureLuaAlbum]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=25
Variable=Text
MeasureName=MeasureAlbum
Delimiter="          "

[StringMeterAlbum]
Meter=String
MeasureName=MeasureLuaAlbum
H=15
X=176
Y=97
StringStyle=Italic
FontSize=20
FontFace=Red Hat Display
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=Shadow

[MeasureStateButton]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=Spotify
PlayerType=STATE
Substitute="0":"#@#Play.png","1":"#@#Pause.png","2":"#@#Play.png"

[MeterPrevious]
Meter=Image
ImageName=#@#Previous.png
X=20
Y=175
W=30
AntiAlias=1
ImageTint=#Color1#
LeftMouseUpAction=[!PluginBang "MeasureStateButton Previous"]

[MeterPlayPause]
Meter=Image
ImageName=#@#Play.png
X=80
Y=175
W=30
AntiAlias=1
ImageTint=#Color1#
LeftMouseUpAction=[!CommandMeasure "MeasureStateButton" "PlayPause"]
DynamicVariables=1

[MeterNext]
Meter=Image
ImageName=#@#Next.png
X=137
Y=175
W=30
AntiAlias=1
ImageTint=#Color1#
LeftMouseUpAction=[!PluginBang "MeasureStateButton Next"]
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Help with syncing Marquee.lua script for multiple texts.

Post by CodeCode »

I have this in my bag of things:

Its not a lua and runs with Rainmeter script instead.
Marquee Example.rar
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Harkeerat16
Posts: 15
Joined: June 10th, 2017, 10:54 am
Location: India

Re: Help with syncing Marquee.lua script for multiple texts.

Post by Harkeerat16 »

Ah, that's helpful, thank you! Wasn't working at first because I don't use a CAD player and had to configure the code for WMP or Spotify but it's almost what I was looking for! I'll experiment with it and see what I can do, thanks! :great:
User avatar
RoseRain
Posts: 42
Joined: June 30th, 2022, 1:39 pm

Re: Help with syncing Marquee.lua script for multiple texts.

Post by RoseRain »

CodeCode wrote: May 16th, 2021, 7:07 am I have this in my bag of things:

Its not a lua and runs with Rainmeter script instead.

Marquee Example.rar
I love this! But there's a problem, I use Spotify, and sometimes it doesn't scroll upon the next song, or, the text doesn't even appear. If I click on next on my Spotify to skip through songs, the skin messes up and doesn't, or partly shows the text, and works again only on a manual refresh, until the next song, then it does it again. Can it maybe, make it refresh on every new track?