It is currently March 28th, 2024, 9:10 am
Discuss the use of Lua in Script measures.
ToyMachine
Posts: 7 Joined: October 11th, 2011, 8:43 pm
Post
by ToyMachine » October 12th, 2011, 1:54 am
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.
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » October 12th, 2011, 11:09 am
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.
jsmorley
Developer
Posts: 22628 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » October 12th, 2011, 2:14 pm
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...
hkgcry2011
Posts: 1 Joined: October 23rd, 2011, 3:03 am
Post
by hkgcry2011 » October 23rd, 2011, 3:05 am
can someone teach me how to edit the Marquee.lua that can display japanese...
Valentine
Posts: 70 Joined: June 30th, 2011, 11:01 am
Location: Daegu, South Korea
Post
by Valentine » November 11th, 2011, 2:10 am
Thank you for useful lua scrip
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » November 30th, 2011, 1:20 pm
Updated because I felt like it.
Grantp
Posts: 82 Joined: November 29th, 2010, 5:28 pm
Post
by Grantp » January 23rd, 2012, 2:31 am
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
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » January 23rd, 2012, 3:10 am
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.
Grantp
Posts: 82 Joined: November 29th, 2010, 5:28 pm
Post
by Grantp » January 23rd, 2012, 3:32 am
That simple.
Thanks.
Grant
XANCI
Posts: 104 Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China
Post
by XANCI » March 6th, 2012, 12:28 pm
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