It is currently November 14th, 2019, 7:47 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 » June 9th, 2013, 4:13 pm

Seahorse wrote:Version 6.2 is rounding numbers, eg if a calc returns 15.8 it displays 16. How do I change this behaviour?

Further to that, the figure above is RAM, and Autoscale does not seem to be supported so I am using a calc:

Code: Select all

[PhysMemTotalCalc]
Measure=Calc
Formula=ROUND((MeasurePhysMemTotal/1024/1024/1024),#Accuracy#)
and I want to append GB. e.g 15.85 GB or whatever.

MeasureName=MeasureTime|MeasureDate|PhysMemTotalCalc GB|PhysMemUsedCalc|PhysMemFreeCalc

If I pop a GB after PhysMemTotalCalc the meter is not displayed at all, so what is the method to achieve this please?
First off, the script does not round anything. In fact it does nothing at all to the measure value except to append them together. I will tell you that it does retrieve the string value instead of the number value which may be the cause.

Second, adding GB to the end of the measure name is telling the script to retrieve the value of the measure named "PhysMemTotalCalc GB" which is invalid.

The feature you ask for would require that this simple script become far more complex.

Edit: This may be even more complicated than I originally believed. The easier path may be to simply change the existing broad-use script to a single purpose version.

Apparently things may change a bit to make this a TON easier.
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: 1220
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Seahorse » June 10th, 2013, 6:44 am

I tried bouncing the calc through a second one to see if that old trick worked but it didn't.

Code: Select all

[PhysMemTotalCalc]
Measure=Calc
Formula=ROUND((MeasurePhysMemTotal/1024/1024/1024),#Accuracy#)

[PhysMemTotalCalcString]
Measure=Calc
Formula=PhysMemTotalCalc
Capture.PNG
Oh, Y=(#SCREENAREAHEIGHT#*0.5) seems to cause it to run very slow like something is going on in the background, haven't bottomed this out either... :???:

Good news about the changes, I will park the idea for now then as clearly not possible presently.
You do not have the required permissions to view the files attached to this post.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

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

Re: [Script] Lua Marquee

smurfier » June 10th, 2013, 2:42 pm

If you want to know what the string value looks like, you need to use a dynamic variable.

Code: Select all

[PhysMemTotalCalc]
Measure=Calc
Formula=ROUND((MeasurePhysMemTotal/(1024**3)),#Accuracy#)

[PhysMemTotalCalcString]
Measure=Calc
Formula=[PhysMemTotalCalc]
DynamicVariables=1
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: 1220
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Seahorse » June 10th, 2013, 3:01 pm

Still returns 16 instead of 15.9 :(
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

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

Re: [Script] Lua Marquee

smurfier » June 10th, 2013, 4:05 pm

Seahorse wrote:Still returns 16 instead of 15.9 :(
I was simply explaining why it wasn't working, and why it's going to stay that way until at least next week.

When you grab the string value of a measure, which is currently what the script does, the decimals do not come along with it. If you want the decimals you need to grab the number value. Now, this gets a little complicated when you don't know if you want the string or number value, and is where some things may be changing.
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: 1220
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Seahorse » June 12th, 2013, 9:19 pm

Cheers, misunderstood your reply. Annoyingly I have a little time on my hands however the water company cut through our cable a few days ago and we have no TV or internet at all, my mobile phone sucks as a replacement...
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: [Script] Lua Marquee

Skymil » September 18th, 2013, 2:59 pm

Hi all.
I have adapted the script to handle UTF-8.
I you have any questions or issues, please tell me.
And thanks smurfier for your script :)
EDIT:
I forgot to tell, if you want to reset the timer, set it to 1, not to 0.
Reset the Timer
!CommandMeasure "MeasureLua" "Timer=1;"
You do not have the required permissions to view the files attached to this post.
User avatar
rm_lion
Posts: 93
Joined: December 27th, 2013, 4:04 pm
Location: Switzerland

Re: [Script] Lua Marquee

rm_lion » August 8th, 2014, 8:08 pm

Thank you very much smurfier.
I use your Lua-Script for my Spotify-Skin (Track Name, Artist Name).
osmija
Posts: 38
Joined: July 1st, 2016, 3:57 pm

Re: [Script] Lua Marquee

osmija » July 6th, 2016, 6:45 pm

is it possible to make the scroll start repeating before the entire string having passed?

so assume this is the string:

A quick - brown fox

towards the end of the marquee all we see is:

wn fox [lots of blank space here]

and not before the entire string is gone (wn fox scrolls away that is) we see the string start over.

Is it possible to make it start over again without waiting out all characters to disappear?

basically, can we choose how many spaces there is at the end, before it starts over?

edit:

here's pictures showing what i mean:

Image
This one shows that 10 characters can be up at the same time.

Image
this shows what i mean that every character have to go away before it starts over. it would be cool if i could already see the string start again on the right side of the "screen" before it goes completely away on the left.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3596
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Script] Lua Marquee

eclectic-tech » July 7th, 2016, 12:58 am

@ osmija

Not easily ...

Hi! Rube Goldberg here! :welcome:

You can modify the 'Marquee.lua' file:

Right after: Text = table.concat(Values, SELF:GetOption('Delimiter', ' ')):gsub('\n', ' ')

Add:

Code: Select all

Text = Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text..SELF:GetOption('Delimiter', '  ')..Text
This will duplicate and concatenate your marquee text 10 times, so you will only see "blank space" once every 10 scrolls of your text... 8-) enough?

A more skilled Lua coder may have a cleaner solution...