It is currently May 3rd, 2024, 7:08 pm

Dynamic string rainmeter

Get help with creating, editing & fixing problems with skins
User avatar
Naruto
Posts: 47
Joined: December 8th, 2012, 8:05 pm
Location: Egypt

Dynamic string rainmeter

Post by Naruto »

Hi,
Need to know how to make a dynamic string meter, where the text is changed with every update, and the all sentences to be displayed are in the same ini file i.e. without importing text from outside the meter file. :D
so how to do this ? (need an example :oops: )
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Dynamic string rainmeter

Post by MerlinTheRed »

Your problem is very similar to the one in this thread. You should watch that one to see if anybody comes up with a solution you can use.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Dynamic string rainmeter

Post by moshi »

Code: Select all

[Variables]
Variable1=Line 1
Variable2=Line 2

[MeasureLine1]
Measure=Calc
Formula=1
Substitute="1":"#Variable1#"

[MeasureLine2]
Measure=Calc
Formula=1
Substitute="1":"#Variable2#"

[MeasureLineNumber]
Measure=Calc
Formula=((Counter %2)+1)

[Meter]
Meter=String
MeasureName=MeasureLine[MeasureLineNumber]
DynamicVariables=1


User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Dynamic string rainmeter

Post by moshi »

Naruto wrote: all sentences to be displayed are in the same ini file i.e. without importing text from outside the meter file
why is that necessary? please explain.
User avatar
Naruto
Posts: 47
Joined: December 8th, 2012, 8:05 pm
Location: Egypt

Re: Dynamic string rainmeter

Post by Naruto »

moshi wrote: why is that necessary? please explain.

not necessary it could be in another text file.txt or .ini but i mean by this that this text is not coming from a website or from the system; i just want to put my on text strings on the desktop and making them change like the Quote of the day.

And BTW please try to explain your solution in more details moshi, as i am new to rainmeter
Last edited by Naruto on December 9th, 2012, 2:46 pm, edited 1 time in total.
User avatar
Naruto
Posts: 47
Joined: December 8th, 2012, 8:05 pm
Location: Egypt

Re: Dynamic string rainmeter

Post by Naruto »

MerlinTheRed wrote:Your problem is very similar to the one in this thread. You should watch that one to see if anybody comes up with a solution you can use.

BTW MerlinTheRed i saw this thread before u put the like here and i understand nothing not the problem nor the solution so i ask my own question .
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Dynamic string rainmeter

Post by jsmorley »

I would put the lines in a .txt file and use Quote plugin to retrieve a random line myself, as it is just easier, but just for arguments sake, here is one way to do it with the text right in the .ini file:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Line1=If after 2 hours in a poker game you are not sure who the pigeon is, you are.
Line2=The lion and the lamb shall lie down together, but the lamb won't get much sleep. 
Line3=A crisis is when you can't say "Let's forget the whole thing." 
Line4=It may be that my whole purpose in life is simply to serve as a warning to others. 
Line5=Diplomacy is the art of saying "nice doggy" until you can find a rock. 

[MeasureRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=5
UpdateRandom=1
UpdateDivider=-1

[MeasureTimer]
Measure=Calc
Formula=(MeasureTimer % 10) + 1
IfEqualValue=1
IfEqualAction=[!UpdateMeasure MeasureRandom][!SetOption MeterQuote Text "#Line[MeasureRandom]#"][!UpdateMeter MeterQuote][!Redraw]
DynamicVariables=1

[MeterQuote]
Meter=String
FontSize=12
FontColor=255,255,255,255
StringStyle=Bold
Antialias=1
User avatar
Naruto
Posts: 47
Joined: December 8th, 2012, 8:05 pm
Location: Egypt

Re: Dynamic string rainmeter

Post by Naruto »

jsmorley wrote:I would put the lines in a .txt file and use Quote plugin to retrieve a random line myself, as it is just easier, but just for arguments sake, here is one way to do it with the text right in the .ini file:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Line1=If after 2 hours in a poker game you are not sure who the pigeon is, you are.
Line2=The lion and the lamb shall lie down together, but the lamb won't get much sleep. 
Line3=A crisis is when you can't say "Let's forget the whole thing." 
Line4=It may be that my whole purpose in life is simply to serve as a warning to others. 
Line5=Diplomacy is the art of saying "nice doggy" until you can find a rock. 

[MeasureRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=5
UpdateRandom=1
UpdateDivider=-1

[MeasureTimer]
Measure=Calc
Formula=(MeasureTimer % 10) + 1
IfEqualValue=1
IfEqualAction=[!UpdateMeasure MeasureRandom][!SetOption MeterQuote Text "#Line[MeasureRandom]#"][!UpdateMeter MeterQuote][!Redraw]
DynamicVariables=1

[MeterQuote]
Meter=String
FontSize=12
FontColor=255,255,255,255
StringStyle=Bold
Antialias=1

ok what about the other solution as putting the text in a .txt file and read them line by line ? i want example on it please
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Dynamic string rainmeter

Post by jsmorley »

Test.txt:

Code: Select all

If after 2 hours in a poker game you are not sure who the pigeon is, you are.
The lion and the lamb shall lie down together, but the lamb won't get much sleep. 
A crisis is when you can't say "Let's forget the whole thing." 
It may be that my whole purpose in life is simply to serve as a warning to others. 
Diplomacy is the art of saying "nice doggy" until you can find a rock.
Test.ini

Code: Select all

[Rainmeter]
Update=1000

[MeasureQuote]
Measure=Plugin
Plugin=QuotePlugin.dll
PathName=#CURRENTPATH#Test.txt
UpdateDivider=10

[MeterQuote]
Meter=String
MeasureName=MeasureQuote
FontSize=12
FontColor=255,255,255,255
StringStyle=Bold
Antialias=1
User avatar
Naruto
Posts: 47
Joined: December 8th, 2012, 8:05 pm
Location: Egypt

Re: Dynamic string rainmeter

Post by Naruto »

Sorry i ask a lot of questions but i think this will be the last,
What if i want to show the quotes in ordered number lines i.e. line 1 appear then line 2, 3 ...
instead of random line selection.
What to do ?