It is currently November 14th, 2019, 7:37 am

[Script] Lua Marquee

Discuss the use of Lua in Script measures.
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

smurfier » September 15th, 2012, 10:06 pm

First off, The bang you need to use is actually !CommandMeasure mTrack Pause=1

When putting mouse actions on string meters it's a good idea to add a solid color (SolidColor=0,0,0,1) otherwise the action will only fire when your mouse actually touches the text itself.

Try those two changes and see if it makes a difference.
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 . . .
CowRocket
Posts: 6
Joined: February 2nd, 2011, 3:59 am

Re: [Script] Lua Marquee

CowRocket » September 21st, 2012, 1:31 am

jsmorley wrote: Not for long... 8-)
Has this been implemented? If i missed the post please forgive me i an a terrible searcher. :oops:
User avatar
sl23
Posts: 407
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [Script] Lua Marquee

sl23 » May 27th, 2013, 11:32 am

I've learnt a LITTLE about Rainmeter from editing other skins, but this Marquee thing has stumped me completely!

I Have edited poiru's Soita media player skin and added a ton of stuff to it so things have become complicated to say the least! I've tried copying your examples in the first post and changing where I think it's needed but I either got no text, no scroll or a '0' ?

I want the Artist, Track and Album text to scroll only on mouse over. However, I've already used MouseOverAction in the Rainmeter section. I have absolutely no idea what I'm doing, is it necessary to edit the LUA in any way?

Any help would be appreciated, thanks.

Scott

EDIT: I've created a copy of my skin and deleted ALL non essential elements. I then added the code stated earlier in this post and all I get is No track name, No artist name and a '0' for Album!
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

smurfier » May 27th, 2013, 1:24 pm

sl23 wrote:I've learnt a LITTLE about Rainmeter from editing other skins, but this Marquee thing has stumped me completely!

I Have edited poiru's Soita media player skin and added a ton of stuff to it so things have become complicated to say the least! I've tried copying your examples in the first post and changing where I think it's needed but I either got no text, no scroll or a '0' ?

I want the Artist, Track and Album text to scroll only on mouse over. However, I've already used MouseOverAction in the Rainmeter section. I have absolutely no idea what I'm doing, is it necessary to edit the LUA in any way?

Any help would be appreciated, thanks.

Scott
The easiest way to help you would be for you to post your skin code, or better yet an rmskin package of the skin.
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 . . .
User avatar
sl23
Posts: 407
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [Script] Lua Marquee

sl23 » May 27th, 2013, 1:37 pm

Thanks smurfier, here's the skin. As I said it's been stripped with just necessary suff in there. The order of Track details is:

Artist
Track
Album
Progress/Duration
Progress Bar

The progress Bar is in correct position and the other details appear above it LeftAligned.

Thanks again.

EDIT: :? Oops! I didn't specify where I put the LUA file! It's in the Resources folder, I've added it and I still get No Artist or Track info but instead of that '0' I get Input Error.
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

smurfier » May 27th, 2013, 2:11 pm

sl23 wrote:Thanks smurfier, here's the skin. As I said it's been stripped with just necessary suff in there. The order of Track details is:

Artist
Track
Album
Progress/Duration
Progress Bar

The progress Bar is in correct position and the other details appear above it LeftAligned.

Thanks again.

EDIT: :? Oops! I didn't specify where I put the LUA file! It's in the Resources folder, I've added it and I still get No Artist or Track info but instead of that '0' I get Input Error.
You were using a previous method of multiple measures. I updated that, as well as other bits of the skin.

Code: Select all

[Rainmeter]
Author=poiru
Update=1000
MouseLeaveAction=[!ShowMeterGroup Hide][!UpdateMeterGroup Hide][!HideMeterGroup Show][!UpdateMeterGroup Show][!ShowMeterGroup HideR][!UpdateMeterGroup HideR][!HideMeterGroup ShowR][!UpdateMeterGroup ShowR][!HideFade "Soita"][!Redraw]
DynamicWindowSize=1

[Metadata]
Name=Soita
Information=Displays track information from various media players.
Version=1.0.1
License=Creative Commons BY-NC-SA 3.0

[Variables]
Update=100
Player=CAD
PlayerChosen=1

;------------------------------------------------------- STYLES
[styleLeftText]
StringAlign=Left
StringStyle=Bold
FontFace=Trebuchet MS
FontColor=0,255,255,250
FontSize=10
AntiAlias=1
ClipString=1
Group=HideR

[styleLeftText2]
StringAlign=Left
StringStyle=Bold
FontFace=Trebuchet MS
FontColor=0,255,255,250
FontSize=9
AntiAlias=1
ClipString=1
Group=Hide

[styleBar1]
BarColor=235,170,0,255
BarOrientation=Horizontal
SolidColor=250,250,250,40

[styleBar2]
BarOrientation=Horizontal
SolidColor=250,250,250,80

;------------------------------------------------------ PLAYER MEASURES
[mPlayer]
Measure=Plugin
Plugin=NowPlaying
PlayerName=#Player#

[mCover]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=COVER
Substitute="":"#@#Default.png"

[mPosition]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=POSITION
Substitute="00:00":"0"

[mDuration]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=DURATION
Substitute="00:00":"Stopped"

[mProgress]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=PROGRESS

;------------------------------------------------------------- GRAPHICS
[Background]
Meter=Image
ImageName=#@#Background.png
X=0
Y=0

[BackgroundCoverW]
Meter=Image
MeterStyle=styleBar2
X=20
Y=18
W=91
H=91

[BackgroundCoverB]
Meter=Image
MeterStyle=styleBar2
SolidColor=0,0,0,190
X=21
Y=19
W=89
H=89

[Cover]
Meter=Image
MeasureName=mCover
SolidColor=255,255,255,10
Group=HideR
X=23
Y=21
W=85
H=85

;----------------------------------------------------------- TRACK INFO
[MeasureMedia1]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=Artist

[MeasureMedia2]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=Title

[MeasureMedia3]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[mPlayer]
PlayerType=Album

[mLua]
Measure=Script
ScriptFile=Marquee.lua
Width=100
MeasureName=MeasureMedia1|MeasureMedia2|MeasureMedia3
Delimiter=" | "

[StringMeter]
Meter=String
MeasureName=mLua
MeterStyle=styleLeftText

;------------------------------------------------------------ PROGRESS
[Time]
Meter=String
MeasureName=mPosition
MeasureName2=mDuration
MeterStyle=styleLeftText
StringStyle=Normal
FontColor=250,250,250,150
Text="%1 / %2"
X=r
Y=15r
W=100
H=14

[ProgressBar]
Meter=BAR
MeasureName=mProgress
MeterStyle=styleBar1
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition $MouseX:%$"]
X=122
Y=80
W=270
H=2

;---------------------------------------------------------------- POWER
[MeasurePower]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent

[MeterPower1]
Meter=RoundLine
MeasureName=MeasurePower
LineLength=30
LineStart=24
LineColor=128,255,0,70
StartAngle=-1.570796325
RotationAngle=6.2831853
Antialias=1
Group=HideR
X=290
Y=12
W=60
H=60
Solid=1

[MeterPower2]
Meter=RoundLine
MeasureName=MeasurePower
LineLength=28
LineStart=26
LineColor=128,255,0,255
StartAngle=-1.570796325
RotationAngle=6.2831853
Antialias=1
Group=HideR
X=r
Y=r
W=60
H=60
Solid=1

[MeasureAc]
Measure=Plugin
PlugIn=PowerPlugin
PowerState=ACLINE
IfAboveValue=0
IfAboveAction=[!SetOption MeterAcImage ImageTint 255,255,255,255]
IfBelowValue=1
IfBelowAction=[!SetOption MeterAcImage ImageTint 0,0,0,0]

[MeterAcImage]
Meter=Image
Group=HideR
ImageName=#@#AC.png
ImageTint=0,0,0,255
X=19r
Y=9r
W=20
H=20

[MeasureBatteryPercent]
Measure=Plugin
Plugin=PowerPlugin
PowerState=Percent

[MeterBatteryPercent]
Meter=String
MeasureName=MeasureBatteryPercent
MeterStyle=styleLeftText
StringAlign=Center
FontSize=8
Text=%1 %
X=12r
Y=24r
W=45
H=10

;------------------------------------------------------------ TIME / DATE
[MeasureTimeS]
Measure=Time
Format=%S
; See here for other formats - http://docs.rainmeter.net/manual/measures/time
UpdateDivider=1
MinValue=0
MaxValue=60

[MeterTimeS1]
Meter=RoundLine
MeasureName=MeasureTimeS
LineLength=24
LineStart=18
LineColor=128,255,0,70
StartAngle=-1.570796325
RotationAngle=6.2831853
Antialias=1
Group=HideR
X=250
Y=20
W=30
H=30
Solid=1

[MeterTimeS2]
Meter=RoundLine
MeasureName=MeasureTimeS
LineLength=22
LineStart=20
LineColor=128,255,0,255
StartAngle=-1.570796325
RotationAngle=6.2831853
Antialias=1
Group=HideR
X=r
Y=r
W=30
H=30
Solid=1

[measureTimeT]
Measure=Time
Format=%#I:%#M

[meterTimeT]
Meter=String
MeasureName=measureTimeT
MeterStyle=styleLeftText
StringAlign=Center
FontSize=8
X=15r
Y=9r
W=40
H=10

;----------------------------------------------------------- LAUNCHERS
[LauncherRefreshSkin]
Meter=Image
ImageName=#@#Refresh.png
LeftMouseUpAction=!Refresh
ToolTipText="Refresh"
X=370
Y=57
W=25
H=25
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 . . .
User avatar
sl23
Posts: 407
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [Script] Lua Marquee

sl23 » May 27th, 2013, 2:53 pm

This line seems to be the only difference:

MeasureName=MeasureMedia1|MeasureMedia2|MeasureMedia3

Now the Input Error has been replaced by that '0' !
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

smurfier » May 27th, 2013, 3:23 pm

sl23 wrote:This line seems to be the only difference:

MeasureName=MeasureMedia1|MeasureMedia2|MeasureMedia3

Now the Input Error has been replaced by that '0' !
Forgot to tell it where to look for the script.

Code: Select all

[mLua]
Measure=Script
ScriptFile=#@#Marquee.lua
Width=100
MeasureName=MeasureMedia1|MeasureMedia2|MeasureMedia3
Delimiter=" | "
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 . . .
User avatar
sl23
Posts: 407
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [Script] Lua Marquee

sl23 » May 27th, 2013, 3:28 pm

Oh yeah, I'd already done that. Not sure why it's not working then?
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -
User avatar
sl23
Posts: 407
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [Script] Lua Marquee

sl23 » May 27th, 2013, 5:52 pm

Actually I used @Resources\Marquee.lua instead of #@#Marquee.lua, now I switched to the latter, it works, strange that it didn't before? I've rearranged the code a little and now it's working. I can't get the font style to work though?

Here's the latest version.
Last edited by sl23 on May 27th, 2013, 5:59 pm, edited 1 time in total.
Live for an ideal and leave no place in the mind for anything else
- MuLab - SoundCloud -