Page 3 of 9

Re: [Script] Lua Marquee

Posted: October 12th, 2011, 1:54 am
by ToyMachine
Here's all I threw together to get Songbird to work. The only thing I would like to change now is how fast the marquee scrolls. It goes too slow as of now.

The skin I'm using is Hexa http://shailendravikram.deviantart.com/art/hexa-1-0-193409276

Code: Select all

[Rainmeter]
Author=shailendravikram kumar (shailendra007smailbox@gmail.com)
;Metadata added by RainBrowser
;http://rainmeter.net/RainCMS/?q=Rainmeter101_AnatomyOfASkin

[Metadata]
Name=
Config=
Description=
Instructions=
Version=
Tags=
License=
Variant=
Preview=

;End of added Metadata
[SongbirdLabel]
Meter=STRING
X=24
Y=12
FontColor=232222
StringStyle=BOLD
Fontsize=11
Fontface=Agency FB
StringEffect=SHADOW
FontEffectColor=255,255,255,100
AntiAlias=1
Text="Songbird"
Hidden=0

[seperator]
Meter=IMAGE
SolidColor=255, 255, 255, 150
X=4
Y=30
W=92
H=1

[StyleButton]
X=15r
Y=76
FontColor=255,255,255
StringStyle=Bold
FontSize=18
StringAlign=LEFT
FontFace=Webdings
AntiAlias=1
Hidden=0

[IconBack]
Meter=IMAGE
ImageName=BG2.png
X=0
Y=0

;-------------------------
; OPEN

[Open]
Meter=IMAGE
ImageName=songbird.png
h=20
w=20
x=40
y=76
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Songbird\songbird.exe"]




;--------------------
; Now Playing


;===============================================================================================
;Variables
;===============================================================================================

[Variables]

;Fonts & Colours
@include="Settings.inc"

;===============================================================================================

[MeasureQuote]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=nowplaying.txt
UpdateDivider=1

[MeasureLua]
Measure=Script
ScriptFile=Marquee.lua
MeasureName=MeasureQuote
Width=30

;===============================================================================================
;Meters
;===============================================================================================

[MeterRefresh]
Meter=BUTTON
X=0
Y=0
ButtonCommand=!UpdateMeasure MeasureQuote
MiddleMouseUpAction=!Execute ["#CURRENTPATH#nowplaying.txt"]

[QuoteString]
Meter=String
MeasureName=MeasureLua
X=5R
Y=36
W=90
H=16
MeterStyle=StringStyleBig
Text=%1

;-----------------------------------------------------------------------------END NOW PLAYING



;-------------------------
; BUTTONS

[Prev]
Meter=STRING
MeterStyle=StyleButton
X=1
y=53
Text="7"
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Songbird\songbird.exe" -previous]


[Play]
Meter=STRING
MeterStyle=StyleButton
Text="4"
y=54
x=34
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Songbird\songbird.exe" -pause]



[Next]
Meter=STRING
MeterStyle=StyleButton
Text=" 8"
y=54
x=52
LeftMouseDownAction=!Execute ["C:\Program Files (x86)\Songbird\songbird.exe" -next]


here's the whole songbird hexa folder also
http://www.mediafire.com/?slgbfdr8j53oa2i

as you can see it's kind of a frankenstien code now..lol..i guessed options till it all worked.

Re: [Script] Lua Marquee

Posted: October 12th, 2011, 11:09 am
by smurfier
The speed of LuaMarquee is completely dependent on the Update of the skin. That is, it moves one character per update. Making it do any different would raise other problems.

Try adding Update=1000 to the Rainmeter section, then gradually lowering the number until the marquee moves the way you want. Once you've done that, Take 1000/YourNumber, Round, and set UpdateDivider=YourNewNumber to the MeasureQuote. This will make sure that the text file isn't being read any more often than it already is.

Re: [Script] Lua Marquee

Posted: October 12th, 2011, 2:14 pm
by jsmorley
smurfier wrote:The speed of LuaMarquee is completely dependent on the Update of the skin. That is, it moves one character per update. Making it do any different would raise other problems.
Not for long... 8-)

Re: [Script] Lua Marquee

Posted: October 23rd, 2011, 3:05 am
by hkgcry2011
can someone teach me how to edit the Marquee.lua that can display japanese...

Re: PROOF OF CONCEPT: Lua Marquee

Posted: November 11th, 2011, 2:10 am
by Valentine
Thank you for useful lua scrip :D

Re: [Script] Lua Marquee

Posted: November 30th, 2011, 1:20 pm
by smurfier
Updated because I felt like it.

Re: [Script] Lua Marquee

Posted: January 23rd, 2012, 2:31 am
by Grantp
Hi, This seems very useful to me but where do I download the LUA Script I can't see a link anywhere.

Many thanks
Grant

[Script] Lua Marquee

Posted: January 23rd, 2012, 3:10 am
by smurfier
It's the second text box in the first post. You will need to copy and paste it into a plain text editor and save it there.

Re: [Script] Lua Marquee

Posted: January 23rd, 2012, 3:32 am
by Grantp
That simple.

Thanks.

Grant

Re: [Script] Lua Marquee

Posted: March 6th, 2012, 12:28 pm
by XANCI
Come up with a simple way, and can use any font:
1.Set W&H in your STRING meter
2.lua code

Code: Select all

function Initialize()
	sText=string.rep(' ',N)..tostring(SKIN:GetVariable("Text"))
	iTextLength=string.len(sText)
	iStart=iTextLength-1
end

function Update()
	iStart=iStart%iTextLength+1
	return string.sub(sText,iStart,iTextLength)
end
the "N" in string.rep represents how many spaces are needed to fill the STRING meter with the given W, you can find it manually and then replace N