It is currently March 28th, 2024, 6:14 pm

Random update (divider?)

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Rodut_Idaks
Posts: 4
Joined: May 23rd, 2020, 9:21 pm

Random update (divider?)

Post by Rodut_Idaks »

Hello,

I want to create a meter which shows a random word from a defined list after a random amount of time. E.g: after loading the skin (best is the skin starts "running" after clicking a button in the skin, but that will come later) the skin should, after a random time, which is defined or restricted from a to b, where a is eg 5 sec's and b is 4 min's, show a word (from a very big list) and after the randomized time shows another word, and so on.

Thus i do not want to show a word (via the quote plugin, i presume) every e.g. 10 min's, but the time inbetween the words should be random, laying between two predefined times. Also the word should be random picked from the text list file.

A) is that possible?

B) Can the update divider be a variable? So for example can i just put: "Updatedivider = variable here." Where "variable here" is the output of a randomize formula/measurement. ?

I hope i made any sense,

Greetz, Tudor.
Last edited by Rodut_Idaks on May 26th, 2020, 12:50 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random update (divider?)

Post by jsmorley »

Perhaps something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[MeasureRandom]
Measure=Calc
Formula=Random
UpdateRandom=1
UniqueRandom=1
LowBound=5
HighBound=240
DynamicVariables=1
UpdateDivider=[MeasureRandom]
OnUpdateAction=[!UpdateMeasure MeasureOutput]

[MeasureOutput]
Measure=Calc
Formula=MeasureRandom
UpdateDivider=-1

[MeterOutput]
Meter=String
MeasureName=MeasureOutput
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
So you use OnUpdateAction=[!UpdateMeasure MeasureOutput] to trigger the Quote plugin measure, instead of the example Calc measure.
User avatar
Rodut_Idaks
Posts: 4
Joined: May 23rd, 2020, 9:21 pm

Re: Random update (divider?)

Post by Rodut_Idaks »

Thanks for the reply. Only the fact that it can be a variable helped a lot. I go try some things and will post the solution if it works. If it does not, hmm well, i'll be back then too. Lol.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random update (divider?)

Post by jsmorley »

Rodut_Idaks wrote: May 23rd, 2020, 10:18 pm Thanks for the reply. Only the fact that it can be a variable helped a lot. I go try some things and will post the solution if it works. If it does not, hmm well, i'll be back then too. Lol.
UpdateDivider certainly can be dynamic, and can be a variable. Lots of ways to come at what you want.
User avatar
Rodut_Idaks
Posts: 4
Joined: May 23rd, 2020, 9:21 pm

Re: Random update (divider?)

Post by Rodut_Idaks »

Hmm, i think it worked.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
ContextTitle=Open Wordlist
ContextAction=["#CURRENTPATH#words_NL_6000"]

[Variables]

[MeasureRandom]
Measure=Calc
Formula=Random
LowBound=5
;HighBound=240
HighBound=24
DynamicVariables=1
UpdateDivider=[MeasureRandom]
OnUpdateAction=[!UpdateMeasure MeasureOutput]

[MeasureOutput]
Measure=Calc
Formula=MeasureRandom
UpdateDivider=-1

[RandomQuote]
Measure=Plugin
Plugin=QuotePlugin
PathName=#CURRENTPATH#words_NL_6000.lst

[MeterQuote]
Meter=String
MeasureName=RandomQuote
FontColor=255,255,255,255
FontFace=Trebucet MS
FontSize=15
FontWeight=700
AntiAlias=1
ClipString=0
Updatedivider=[MeasureRandom]
DynamicVariables=1
The output is a random word after a random amount of time. Ok, now it has to make sound when a new word pops up, log the showed words to a file and so on and so on.

Thanks. :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Random update (divider?)

Post by balala »

Rodut_Idaks wrote: May 23rd, 2020, 11:16 pm Hmm, i think it worked.
One more additional detail: the ["#CURRENTPATH#words_NL_6000"] command doesn't work into the ContextAction option of the [Rainmeter] section, because words_NL_6000 is a .lst file, according to PathName option of the [RandomQuote] measure, so in the ContextAction option the extension is required, to can open the file: ContextAction=["#CURRENTPATH#words_NL_6000.lst"].
User avatar
Rodut_Idaks
Posts: 4
Joined: May 23rd, 2020, 9:21 pm

Re: Random update (divider?)

Post by Rodut_Idaks »

Hoh, that must be a typo or something. I would have noticed it one time or another. Thanks anyway. :thumbup:

The script now logs the generated words in a list too. I'm getting somewhere. Now i'm gonna try letting the webparser make something of that list, so the generated words are visible in another (or same) skin. 8-)
Post Reply