Page 5 of 9

Re: PROOF OF CONCEPT: Lua Marquee

Posted: September 8th, 2012, 7:27 pm
by darcilicious
smurfier wrote:Here is my working code with NowPlaying.
Hi there,

In my skin I have the Artist and Track as two separate meters:

Artist: ArtistName
Track: TrackName

(The "Artist:" and "Track:" labels are separate meters as well)

Would it be possible use your script to have just ArtistName and TrackName to scroll? I'm brand new to Rainmeter though I've managed to modify a number of skins to get them to work the way I'd like. The only thing that's missing from my NowPlaying skin for Spotify in ABP is to get these two items to scroll horizontally...

Thanks in advance for any help you can provide!

Re: [Script] Lua Marquee

Posted: September 8th, 2012, 8:56 pm
by darcilicious
Okay, I think I found a problem?

Turning on debug I see this in the log file:

ERRO (04:21:42.655) Script: Marquee.lua:39: attempt to concatenate a boolean value

I get this in two skins, my modified NowPlay skin and the sample skin/.ini in the first post of this thread. In both cases, the skin/meter displays 0 or 0.0

Not sure what the fix is?

Re: [Script] Lua Marquee

Posted: September 8th, 2012, 10:43 pm
by smurfier
Please try the version I just posted on the first page. Seems I forgot some parenthesis.

Re: [Script] Lua Marquee

Posted: September 8th, 2012, 11:27 pm
by darcilicious
That fixed it, thanks!

Any thoughts about my first post above? I'd rather not spend a lot of time fiddling trying to get it to work if the script doesn't support it (which is fine).

Thanks!

Re: [Script] Lua Marquee

Posted: September 8th, 2012, 11:44 pm
by smurfier
You will simply need to use two script measures, one for each meter.

Re: [Script] Lua Marquee

Posted: September 15th, 2012, 6:10 am
by darcilicious
Perfect, that did the trick.

Quick question -- would it be possible for the initial display of the text to start in the "0" position and display the maximum numbers of characters initially and then start scrolling?

No worries if it can't be done or if you don't feel like doing it (but if it's the latter, that'd be good to know as I can make my hubby learn enough Lua this weekend to modify your script...)

Thanks again for a great script!

Re: [Script] Lua Marquee

Posted: September 15th, 2012, 11:57 am
by smurfier
On the script measure set the Position option to Left.

Re: [Script] Lua Marquee

Posted: September 15th, 2012, 2:34 pm
by darcilicious
Oh, right, options :) However after doing this:
  • Position
    • When set to LEFT, the string starts on the left side of the marquee.
It turns out it only "works" on the first "cycle" of the string; when the next cycle starts, the string starts in the original position...

And if the string is not long enough to need scrolling then the string gets repeated without scrolling, e.g. "Crying SineCrying" is what my meter is currently displaying because "Crying Sine" doesn't need to scroll.

Also, I tried using the mouseover unpause/pause commands and couldn't get them to work. The info from the original post is slightly inconsistent so it's very possible I'm not setting it up right.
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
These last two lines -- should they be like this?

MouseOverAction=[!Command "MeasureLua" "Pause=1"]
MouseLeaveAction=[!Command "MeasureLua" "Pause,Timer=0,0"]

If so, they don't seem to work.

However this works

MouseOverAction=[!CommandMeasure "MeasureLua" "Pause=1-Pause"]

if I mouse over the text twice ;)

Thanks again for your help, I'm SO close now :)

Re: [Script] Lua Marquee

Posted: September 15th, 2012, 4:22 pm
by smurfier
Could you please post your skin code so that I can see what's going on?

Re: [Script] Lua Marquee

Posted: September 15th, 2012, 4:31 pm
by darcilicious
Sure. Text styles are coming from the JSMeterV theme.

Code: Select all

[MeterAllBackground]
Meter=IMAGE
W=160
H=75
SolidColor=0,0,0,1

[MeterTitle]
Meter=STRING
X=0
Y=0
StringAlign=Left
Text="Now Playing"
AntiAlias=1
FontFace=#FontFace#
FontColor=#Color1#
FontSize=14

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=Spotify
; Edit PlayerName= above. A list of valid values is available
; from: http://rainmeter.net/cms/Plugins-NowPlaying_beta#playerlist
PlayerType=TITLE
Substitute="":"N\A"

[ArtistLabel]
Meter=STRING
StringAlign=Left
AntiAlias=1
FontColor=#Color2#
FontFace=#FontFace#
FontSize=12
X=r
Y=24
Text="Artist:"

[MeasureMediaArtist]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=ARTIST

[mArtist]
Measure=Script
ScriptFile=Marquee1.lua
MeasureName=MeasureMediaArtist
NumOfMeasures=1
Width=17

[ArtistName]
Meter=String
MeasureName=mArtist
AntiAlias=1
FontFace=#FontFace#
FontColor=#Color2#
FontSize=12
X=35r
Y=r

[TrackLabel]
Meter=STRING
AntiAlias=1
FontFace=#FontFace#
FontColor=#Color2#
FontSize=12
X=-35r
Y=15r
Text="Track:"

[MeasureMediaTrack]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=TITLE

[mTrack]
Measure=Script
ScriptFile=Marquee2.lua
Width=17
MeasureName=MeasureMediaTrack
Position=Left
Pause=0

[TrackName]
Meter=String
MeasureName=mTrack
AntiAlias=1
FontFace=#FontFace#
FontColor=#Color2#
FontSize=12
X=35r
Y=r
MouseOverAction=[!Command "mTrack" "Pause=1"]
MouseLeaveAction=[!Command "mTrack" "Pause,Timer=0,0"]