It is currently March 29th, 2024, 6:22 am

[Script] Line Scroller

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

Re: [Script] Line Scroller

Post by smurfier »

AlC wrote:But now I can't scroll or better said no CommandMeasure work. I don't know if the code is false, but with the old LineScroller script I can scroll up and down.
With the new I can do nothing.
Seahorse wrote:Scrolling is not working here either, line breaks are... :???:
Please try the new version in my first post. Please note that the function for scrolling has changed.
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
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Line Scroller

Post by Seahorse »

No changes to main script other than commandmeasures, only changed lines to 20 in the lua. The following does nothing though lyrics are displayed with line breaks.

Code: Select all

[MeterPageUp]
Meter=BUTTON
ButtonImage=#ROOTCONFIGPATH#\Images\PrevButton.png
X=380
Y=180
LeftMouseUpAction=!CommandMeasure "MeasureLua" "Scroll(PROPERTIES.Lines)"

[MeterScrollUp]
Meter=BUTTON
ButtonImage=#ROOTCONFIGPATH#\Images\VolUpButton.png
X=r
Y=R
LeftMouseUpAction=!CommandMeasure "MeasureLua" "Scroll(1)"

[MeterScrollDown]
Meter=BUTTON
ButtonImage=#ROOTCONFIGPATH#\Images\VolDnButton.png
X=r
Y=R
LeftMouseUpAction=!CommandMeasure "MeasureLua" "Scroll(-1)"

[MeterPageDown]
Meter=BUTTON
ButtonImage=#ROOTCONFIGPATH#\Images\NextButton.png
X=r
Y=R
LeftMouseUpAction=!CommandMeasure "MeasureLua" "Scroll(-PROPERTIES.Lines)"
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Line Scroller

Post by smurfier »

I made significant changes to the main script as well. If you did not change the whole file, I suggest you do so now. If you had and are still having the problems, then I'm at a loss as it works perfectly for me.
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
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Line Scroller

Post by Seahorse »

This is with a completely replaced the lua, edited lines to 20 in it, added the new meters as above.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Script] Line Scroller

Post by AlC »

I still have the problems, no CommandMeasure works.
The Title and Lines variables work. It displays everything nice.

I tried it with a normal txt file,too. But with the same result.

If it works for you, could you post your skincode here or post/upload a testskin that works ?
Maybe we forget something or have something false.

Because it is a little bit special when no CommandMeasure works and I get nothing in my log and everything else works perfect.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Line Scroller

Post by smurfier »

This is the skin file that I'm using for testing purposes:

Code: Select all

[Rainmeter]
Author=Smurfier
Update=1000
DynamicWindowSize=1

[Metadata]
Name=
Description=
Instructions=
Version=
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
BoxWidth=200
BoxHeight=80

[First]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=iTunes
PlayerType=Lyrics
;TrackChangeAction=!CommandMeasure "Lua" "LoadLines()"

[Lua]
Measure=Script
ScriptFile=Lua.lua
;MeasureName=First
FileName=#CURRENTPATH#Notes.txt
;MeterPrefix=String
Meter=String1

[String1]
Meter=String
FontColor=255,255,255,255
H=#BoxHeight#
W=#BoxWidth#
SolidColor=100,100,100,255

;[String2]
;Meter=String
;MeterStyle=String1
;Y=R

;[String3]
;Meter=String
;MeterStyle=String1
;Y=R

;[String4]
;Meter=String
;MeterStyle=String1
;Y=R

;[String5]
;Meter=String
;MeterStyle=String1
;Y=R

[LinesString]
Meter=String
FontColor=255,255,255,255
Text=#Lines#
Y=R
DynamicVariables=1

[Left]
Meter=String
Text=<
FontColor=255,255,255,255
SolidColor=0,0,0,1
LeftMouseUpAction=!CommandMeasure "Lua" "Scroll(-1)"
;LeftMouseUpAction=!CommandMeasure "Lua" "ChangeInput(-1)"
Y=R

[Right]
Meter=String
Text=>
FontColor=255,255,255,255
SolidColor=0,0,0,1
LeftMouseUpAction=!CommandMeasure "Lua" "Scroll(1)"
;LeftMouseUpAction=!CommandMeasure "Lua" "ChangeInput(1)"
Y=r
X=#BoxWidth#
StringAlign=Right
Last edited by smurfier on October 23rd, 2011, 2:26 am, edited 1 time 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 . . .
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Line Scroller

Post by Seahorse »

Smurfier, you seem to be using a text file, in [Lua] FileName=#CURRENTPATH#Notes.txt. Is this an intermediate step or you aren't pulling song lyrics at all?
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Line Scroller

Post by smurfier »

The new version of the script can read from both a text file and a measure, switching between the multiple inputs with ChangeInput(). It works appropriately for either, at least for me.

EDIT: I have to ask, have you restarted either Rainmeter or your computer lately?
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
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [Script] Line Scroller

Post by AlC »

I'm going crazy...

So I took your code and added only these lines at the end ( + changed iTunes to Winamp)

Code: Select all

[LeftScroll]
Meter=String
Text=<
FontColor=255,255,255,255
SolidColor=0,0,0,1
LeftMouseUpAction=!CommandMeasure "Lua" "Scroll(1)"
Y=5R

[RightScroll]
Meter=String
Text=>
FontColor=255,255,255,255
SolidColor=0,0,0,1
LeftMouseUpAction=!CommandMeasure "Lua" "Scroll(-1)"
Y=r
X=#BoxWidth#
StringAlign=Right
Created the Lua.lua file and a Notes.txt like this:
asdasdasd
sa
d
asd
as
d
sad
asdasdasdasd
sadasd

asdasdasdas


asdasdasdasdas
asdas
a
sasaasaas
a
asas
asas
asa
saa
asasas
asassa
as
assaas
asas



sadasdasdaskjdklasjdasd
asdasdas
dsa
d
asd

htrhjuzkuzkz
uzkzuk
zuk
zukzukzu
kuzk
zukzu
kzu
kzukzuk
zukzuk
zukzuk
zukzuk
zukzuk
zukzuk
zukzuk
zukzuk


uzkuzkzuk
zukzukz
zukzukzu
kuz
kzukzukzu
kzu
kzukzukzuk
zuk
uzkzukzukuz
zukzukzukzuk
zukuzk
zukuzk
uzk
zuk
uiloio
uiiuooöloöoi
öp
öpoö
opöioöioö
ioöioöio
öioöioöoi
öoi
öioöioöio
öioö
oiöioö
oiöioö
ioöio
öoiö
ioöoiöioö
oiöoiö
ioö
oiöioöoi
öioöio
öio
öoiöoiöioö
oi
öoi
öio
öioöioöoiö
oiö

oiöoiöioöioö
oöiioö
oiöioöo

oöoö
öoöo
1. - switching between the multiple inputs with ChangeInput() - : works
2. I can't scrolling the txt file

3. What is very mysterious
The most lyrics doesn't work -> I can't scrolling

BUT I found now 3 songs and with these 3 songs I can scroll. O.O
I have no idea why I can scroll with these 3 songs.

And I did some restarts and restarted rainmeter sometimes.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Line Scroller

Post by smurfier »

My code tells me how many lines are being detected. Obvious question, are there enough lines to scroll?
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 . . .