Well, you asked for it... my issue now is that I cannot figure how to escape some characters to write some stuff.... for example in line 32, it writes on the destined file only
argument which should be the name of the measure.
or double quotes inside of double quotes... and it's a mess in general... I'll figure it out eventually.
If you see line 68, I managed to make the bang get written correctly by escaping the brackets like that:
Code: Select all
function Update()
AllDisksLua = SKIN:GetVariable('AllDisks')
NumOfLetters = string.len(AllDisksLua)
end
function Split()
for i in string.gmatch(AllDisksLua, "%a") do
--Variable creation
SKIN:Bang(string.format('!WriteKeyValue Variables "Underliner_Width_%s" "0" "#@#Variables.inc"',i))
--Measure creation
SKIN:Bang(string.format('!WriteKeyValue MeasureTotalDisk%s "Measure" "FreeDiskSpace" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeasureTotalDisk%s "Drive" "%s:" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue MeasureTotalDisk%s "Total" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeasureTotalDisk%s "UpdateDivider" "100" "#@#FileToEdit.txt"',i))
--%s????????????
SKIN:Bang(string.format('!WriteKeyValue MeasureUsedDisk%s "Measure" "FreeDiskSpace" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeasureUsedDisk%s "Drive" "%s:" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue MeasureUsedDisk%s "InvertMeasure" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeasureUsedDisk%s "UpdateDivider" "100" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "Measure" "Plugin" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "Plugin" "ActionTimer" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "ActionList1" "UpdateOnce | Wait 16 | Repeat IconAnimationIn, 16, 16" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "UpdateOnce" "[!Update]" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "IconAnimationIn" "[!SetVariable Underliner_Width_%s (Clamp(#Underliner_Width_%s#+25,0,(#MaxWidth#-[MeterDisk%s_Name:X]*2)))][!UpdateMeter Underliner_%s][!UpdateMeasure #CurrentSection#][!Redraw]" "#@#FileToEdit.txt"',i,i,i,i,i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "ActionList2" "UpdateOnce | Wait 25 | Repeat IconAnimationOut, 16, 13" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "IconAnimationOut" "[!SetVariable Underliner_Width_%s (Clamp(#Underliner_Width_%s#-20,0,(#MaxWidth#-[MeterDisk%s_Name:X]*2)))][!UpdateMeter Underliner_%s][!UpdateMeasure #CurrentSection#][!Redraw]" "#@#FileToEdit.txt"',i,i,i,i,i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "ActionList3" "UpdateOnce | Wait 25 | Repeat MouseUp, 16, 6" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue DiskAnimation%s "MouseUp" "[!SetVariable Underliner_Width_%s (Clamp(#Underliner_Width_%s#-20,130,(#MaxWidth#-[MeterDisk%s_Name:X]*2)))][!UpdateMeter Underliner_%s][!UpdateMeasure #CurrentSection#][!Redraw]" "#@#FileToEdit.txt"',i,i,i,i,i))
--print(i)
--Meter creation
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "Meter" "String" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "MeterStyle" "NormalLeft" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "X" "#XFromTheWall#" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "Y" "20r" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "Text" ""%s:\"" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "DynamicVariables" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Name "UpdateDivider" "-1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "Meter" "String" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "MeasureName" "MeasureUsedDisk%s" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "MeasureName2" "MeasureTotalDisk%s" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "MeterStyle" "NormalRight" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "X" "(#MaxWidth#-#XFromTheWall#)" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "Y" "r" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "Text" "%%1B/%%2B" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "NumOfDecimals" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "AutoScale" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue MeterDisk%s_Value "UpdateDivider" "100" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "Meter" "Shape" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "X" "0" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "Y" "([MeterDisk%s_Name:Y]-[MeterDisk%s_Name:W]/2)" "#@#FileToEdit.txt"',i,i,i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "Shape" "Rectangle 0,0,#MaxWidth#,(\[MeterDisk%s_Name:H\]*1.75) | Fill Color 0,0,0,0 | StrokeWidth 0" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "MouseOverAction" "[!CommandMeasure DiskAnimation%s ""Stop 2""][!CommandMeasure DiskAnimation%s \"Execute 1\"]" "#@#FileToEdit.txt"',i,i,i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "MouseLeaveAction" "[!CommandMeasure DiskAnimation%s ""Stop 1""][!CommandMeasure DiskAnimation%s \"Execute 2\"]" "#@#FileToEdit.txt"',i,i,i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "LeftMouseUpAction" "\[%s:\\]" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "DynamicVariables" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Background_Disk_%s "UpdateDivider" "-1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "Meter" "Shape" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "X" "(#MaxWidth#/2-#Underliner_Width_%s#/2)" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "Y" "-5R" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "Shape" "Rectangle 0,0,#Underliner_Width_%s#,1 | Fill Color #AccentColor# | StrokeWidth 0" "#@#FileToEdit.txt"',i,i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "DynamicVariables" "1" "#@#FileToEdit.txt"',i))
SKIN:Bang(string.format('!WriteKeyValue Underliner_%s "UpdateDivider" "-1" "#@#FileToEdit.txt"',i))
end
end