Oh, so that means the formula could be included directly instead of letting rainmeter do de math, so something like (<x>-1). Yah, it could be useful, not much in this case tho lol. But it gave me an idea, sadly I already implemented the groups I mentioned on my earlier post.If you mean the formula part in the .lua script, i.e. string.gsub(formula, '<x>', tostring(indexes[tonumber(occurrence)] or '0')), it just replaces <x> with the value of the indicated index in case you want to do math with that index directly when you call the function. It probably isn't absolutely needed, but it was mentioned in that thread and I thought it was a nice "feature" to have (though a bit useless since Rainmeter can do math too with the function result afterwards anyway).
I was thinking I could use a different formula for the Y position on the shape meters. That have the s,
They go like sensor1 and sensor1s, which would be index 1 and 2, so I could simple add + 1 to the formula so it counts it as index 2.
No I think it would have to be something different.
Since sensor6 and sensor6s would be indices 11 and 12, so the formula should go times 2 minus 1 instead of only plus 1.
I gotta think about it.
EDIT.
Alright I tested and it works perfectly. I didn't understand the occurrence part at first. I thought first meant like the index was the first character and last the last. But it is the first occurrence of a number, so no matter where the number is, it will return it. So if you have more than one number on a section you can choose which number an so on. That's pretty neat.
So I only needed to do it like this: y=(Round([FGap]*([&S:sectionIndex('[#CurrentSection]','first','((<x>*2)-1)')]))-Round([FGap]*(([&S:sectionIndex('[#CurrentSection]','first','((<x>*2)-1)')])-1)))R
for the String meters (Sensor1,Sensor2 and so on).
and like this: y=(Round([FGap]*([&S:sectionIndex('[#CurrentSection]','first','(<x>*2)')]))-Round([FGap]*(([&S:sectionIndex('[#CurrentSection]','first','(<x>*2)')])-1)))R
for the shape meters (Sensor1s,Sensor2s and so on).
I guess I could also add the whole thing to the formula part like ([&FGap]*(<x>*2)).
Pretty neat function you made
Statistics: Posted by RicardoTM — Yesterday, 8:37 pm