It is currently April 20th, 2024, 3:47 am

Brackets problem with #CURRENTSECTION#

Get help with creating, editing & fixing problems with skins
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

Maybe this is not what you are looking for, but I found this solution:

skin.ini

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!EnableMeasure MeasureDummy][!UpdateMeasure MeasureDummy]

[Variables]
@include=#@#Construction\core.inc
@include2=#@#Settings\timetable.inc

[MeasureDummy]
Measure=Script
ScriptFile=luatest.lua
Disabled=1

[TBL_11_TC_C]
Meter=Image
MeterStyle=CnsTblCell

[TBL_12_TC_C]
Meter=Image
MeterStyle=CnsTblCell

[TBL_13_TC_C]
Meter=Image
MeterStyle=CnsTblCell
core.inc

Code: Select all

[CnsTblCell]
DynamicVariables=1
UpdateDivider=-1
Group=GrpCell
X=0
Y=5R
W=150
H=30
SolidColor=45,45,45,150
timetable.inc

Code: Select all

[Variables]
TBL_11_TC_C=C:\
TBL_12_TC_C=C:\Users
TBL_13_TC_C=C:\Windows
luatest.lua

Code: Select all

function Initialize()

mt = {}              -- create the matrix
    
	for i=1,1 or nill do
      mt[i] = {}     -- create a new row
      
	  for j=1,3 or nill do
        mt[i][j] = '#TBL_'..i..j..'_TC_C#'
      
	   
         SKIN:Bang('!SetOption', 'TBL_'..i..j..'_TC_C', 'LeftMouseUpAction', '['..'"'..mt[i][j]..'"'..']')
	  
	  end
     
   end
	
end

function Update()

  
end
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

FreeRaider, the log throws me error: [MeasureDummy] | Script: File not valid

With my little lua knowledge I see no mistakes in your code, but sadly I don't understand what can cause rainmeter to show this type of error.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

Really weird, it works for me.

I have put luatest.lua [with encoding UTF-8 (in notepad++)] in same folder of skin.ini

:confused: :confused: :confused:
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

FreeRaider wrote:Really weird, it works for me.

I have put luatest.lua [with encoding UTF-8 (in notepad++)] in same folder of skin.ini

:confused: :confused: :confused:
Can you please make a .rmskin of this skin? I just don't see what I miss here. :???:

Oh my, I had put it into a wrong skin folder. My, my. Sorry, I have lack of sleep these days. Thank you so much for the lua script. It works just great.

I have one question. How do I expand it? I mean, I have here not only TBL_11_TC_C and TBL_12_TC_C, but also
TBL_21_TC_C - TBL_29_TC_C, TBL_31_TC_C - TBL_39_TC_C, etc.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

Of course.
You do not have the required permissions to view the files attached to this post.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

We suppose that you start from TLB_11_TC_C to TLB_39_TC_C

In lua script there are "i" (rows) and "j" (columns),

Code: Select all

...
for i=1,3 or nill do
      mt[i] = {}    
      
     for j=1,9 or nill do
        mt[i][j] = '#TBL_'..i..j..'_TC_C#'
...
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Brackets problem with #CURRENTSECTION#

Post by Active Colors »

FreeRaider wrote:We suppose that you start from TLB_11_TC_C to TLB_39_TC_C

In lua script there are "i" (rows) and "j" (columns),

Code: Select all

...
for i=1,3 or nill do
      mt[i] = {}    
      
     for j=1,9 or nill do
        mt[i][j] = '#TBL_'..i..j..'_TC_C#'
...
You just can't imagine how happy I am now. Thank you so much, mate!
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Brackets problem with #CURRENTSECTION#

Post by FreeRaider »

And I am glad you like this solution.