It is currently March 28th, 2024, 9:54 pm

[Script] Lua Marquee

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] Lua Marquee

Post by smurfier »

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: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Post by Seahorse »

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: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

Post by smurfier »

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: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Post by Seahorse »

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: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Script] Lua Marquee

Post by smurfier »

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: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: [Script] Lua Marquee

Post by Seahorse »

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

Post by Skymil »

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

Post by rm_lion »

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

Post by osmija »

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: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Script] Lua Marquee

Post by eclectic-tech »

@ 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...