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

Help: Rainmeter Skins • Re: Help with leading zeroes and counting files in a folder

$
0
0
Hello again. Sorry, I thought I replied to the last post. You've all been very helpful, thanks so much.

I have a couple of friends using this skin and they've pointed out a quirk I hadn't noticed before. Sometimes (but not every time) when Rainmeter first loads, or when you reload the skin, one of the images will load for about second before switching to another. It's always 002.png in my case. All of the images are labelled numerically, so for some reason it's always the second picture that flashes up.

I've attempted to fix it myself, but at this point I'm completely lost, so any help would be appreciated.

Here's the complete code:

Code:

[Rainmeter]Update=1000[Metadata]Name=PolaroidAuthor=Mifdy[Variables]ImagePath=#ROOTCONFIGPATH#ImagesSecondsBetween=3600[MeasureFolder]Measure=PluginPlugin=FileViewRecursive=2Path=#ImagePath#Extensions=jpg;png;bmpFinishAction=[!EnableMeasure MeasureRandom][!ShowMeter MeterBackground][MeasureCount]Measure=PluginPlugin=FileViewPath=[MeasureFolder]Type=FileCount[MeasureRandom]Measure=ScriptScriptFile=Random.luaDisabled=1UpdateDivider=#SecondsBetween#[MeasureImagePath]Measure=PluginPlugin=FileViewPath=[MeasureFolder]Type=FilePathIgnoreCount=1Index=[MeasureRandom]DynamicVariables=1[MeterBackground]Meter=ImageW=465H=580X=0Y=0SolidColor=60,60,60,0Hidden=1[ImageBackground]Meter=ImageW=384H=384X=28Y=80SolidColor=60,60,60,170Hidden=0[MeterImage]Meter=ImageW=384H=384X=28Y=85MeasureName=MeasureImagePathPreserveAspectRatio=1LeftMouseUpAction=[!UpdateMeasure MeasureRandom][!UpdateMeasure MeasureImagePath][!UpdateMeter *][!Redraw]DynamicVariables=1[Background]Meter=ImageImageName=#ROOTCONFIGPATH#@Resources\frame.pngSolidColor=255,255,255,0X=0Y=50W=444H=530[Background2]Meter=ImageImageName=#ROOTCONFIGPATH#@Resources\tape.pngSolidColor=255,255,255,0X=215Y=5W=244H=144[MeasureNotes]Measure=PluginPlugin=QuotePluginPathName=#ROOTCONFIGPATH#Caption.txtSeparator=¶UpdateDivider=-1[Notes]Meter=StringMeasureName=MeasureNotesFontSize=30SolidColor=0,0,0,0StringAlign=leftFontColor=0,0,0,250FontFace=GINETTEClipString=1Antialias=1Angle=(Rad(-3))X=80Y=490W=310H=65LeftMouseUpAction=[#CURRENTPATH#Caption.txt]RightMouseDownAction=[!UpdateMeasure MeasureNotes][!UpdateMeter MeterImage][!Redraw]
And here's the Lua code, in case that helps:

Code:

function Initialize()msMeasureCount = SKIN:GetMeasure("MeasureCount")currentTable = {}end -- Initializefunction Update()fileCount = msMeasureCount:GetValue()if #currentTable == 0 thencurrentTable = RandomOrder(fileCount)endreturn table.remove(currentTable)end-- Updatefunction RandomOrder(inputCount)assert(type(inputCount) == 'number', ('RandomOrder must receive a number. Received %s instead.'):format(type(inputCount)))local sortedTable, unsortedTable = {}, {}for inc = 1, inputCount dounsortedTable[inc] = incendmath.randomseed(tonumber(tostring(os.time()):reverse():sub(1,6)))while #unsortedTable > 0 dotable.insert(sortedTable, table.remove(unsortedTable, math.random(1, #unsortedTable)))endunsortedTable = nilreturn sortedTableend -- RandomOrder
Thanks again!

Statistics: Posted by Mifdy — Today, 1:04 pm



Viewing all articles
Browse latest Browse all 1486

Trending Articles