Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 482

Quote Skin: How can I iterate through all lines of a textfile using a lua script?

$
0
0
1.) So I have patched this quote skin together for my secondary screen and the quotes are displayed randomly from a textfile. But instead of displaying them randomly, I want to modify the script so it displays one line after line with each update. I know its simple with a lua script but I cant figure it out. Thank you for your help!

Image of the skin at the bottom (centered text on transparent box):
Image

Bonus questions if someone wants to bother:
2.) How can I make one version of the script that displays quotes in random order but without repetition? So all seen quotes or the indexes of seen lines are saved in an array for example.
3.) I'd like to increase/decrease textsize with mousewheel with a set width. But I can manage this part myself, just need to find some time.

The code:

Code:

[Rainmeter]Update=1000[Rainmeter]Update=1000[MeasureFile]Measure=PluginPlugin=Plugins\QuotePlugin.dllPathName=#CURRENTPATH#affirmations.txtSubfolders=0UpdateDivider=3600 ; Updates every 1 hour[Variables]Scale=1[MeterShape1]Meter=ShapeShape=Rectangle 0,0,(1920*#Scale#),(60*#Scale#),0 | Fill Color 0,0,0,170 | StrokeWidth 0MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+0.1,0.5,3))][!UpdateMeter *][!Redraw]MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-0.1,0.5,3))][!UpdateMeter *][!Redraw]DynamicVariables=1H=50W=1920 MiddleMouseUpAction=!RainmeterUpdateMeasure MeasureFileLeftMouseUpAction=["#CURRENTPATH#affirmations.txt"] ; Opens the text file on left mouse click[Meter1]Meter=StringMeasureName=MeasureFileX=(([MeterShape1:W])*0.5)Y=(([MeterShape1:H])*0.5)FontColor=255,255,255,255 ; White colorFontFace=CalibriFontSize=24 ;(22*(#Scale#*1.4)) ;Scales textsize with mousewheelFontWeight=700AntiAlias=1StringAlign=CenterCenterDynamicVariables=1

Version:
Rainmeter 4.5.19.3753 (64-bit)
Language: German (1031)
Build time: 2024-08-08 8:45:56
Windows 10 IoT Enterprise LTSC 2021 21H2 (build 19044.4780) 64-bit - German (1031)
Path: C:\Program Files\Rainmeter\
SkinPath: C:\Users\User\Documents\Rainmeter\Skins\
SettingsPath: C:\Users\User\AppData\Roaming\Rainmeter\
IniFile: C:\Users\User\AppData\Roaming\Rainmeter\Rainmeter.ini

Statistics: Posted by Reaffirm7 — Yesterday, 11:39 am — Replies 3 — Views 179



Viewing all articles
Browse latest Browse all 482

Trending Articles