Code: Select all
[Rainmeter]
Update=1000
[Variables]
CurN=0
[Count]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat ObjIconWGet, 5, 11
ObjIconWGet=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw]
DynamicVariables=1
Disabled=0
Code: Select all
[Rainmeter]
Update=1000
[Variables]
CurN=0
[Count]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat ObjIconWGet, 5, 11
ObjIconWGet=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw]
DynamicVariables=1
Disabled=0
Works for me. Don't forget that you have to have an action that executes the ActionTimer measure.Active Colors wrote: ↑April 22nd, 2021, 9:53 am I might be overlooking something simple in my code. It just doesn't work.I basically want to increment the CurN variable by one 11 times.Code: Select all
[Rainmeter] Update=1000 [Variables] CurN=0 [Count] Measure=Plugin Plugin=ActionTimer ActionList1=Repeat ObjIconWGet, 5, 11 ObjIconWGet=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw] DynamicVariables=1 Disabled=0
Code: Select all
[Rainmeter]
Update=1000
OnRefreshAction=[!CommandMeasure Count "Execute 1"]
[Variables]
CurN=0
[Count]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat ObjIconWGet, 5, 11
ObjIconWGet=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw]
DynamicVariables=1
Disabled=0
Ah, I forgot about this! And when refreshing my memory by checking the docs I simply didn't read it by the end where it explicitly says:
It counts up to 11 for me with exactly your code...Active Colors wrote: ↑April 22nd, 2021, 10:05 am Ah, I forgot about this! And when refreshing my memory by checking the docs I simply didn't read it by the end where it explicitly says:
"The plugin will take no action unless triggered with one of these commands".
However the variable stops at the value 1. I believe the action is repeated 11 times but the variable is not incremented after the first cycle. Am I overlooking something here again?
My bad. I had DefaultUpdateDivider=-1 in [Rainmeter]. It works now. Thank you!
I am facing another problem now with slightly modified code.
Code: Select all
[Rainmeter]
Update=1000
OnRefreshAction=[!CommandMeasure Count "Execute 1"]
[Variables]
CurN=0
CurS=0
[Count]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Set1, 5, 10
Set1=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw][!SetVariable CurS "(#CurN#)"][!Update][!Redraw]
UpdateDivider=1
DynamicVariables=1
Disabled=0
Yes. The value of #CurN# is still the old value during the execution cycle, so setting #CurS# to the value of #CurN# during the cycle will always be one update behind. Use this:Active Colors wrote: ↑April 22nd, 2021, 10:50 am I am facing another problem now with slightly modified code.
Here CurN becomes 10 and supposedly CurS should become 10 as well but CurS stays one cycle beyond and after 10 repeats it stays 9. Any idea why is it happening?Code: Select all
[Rainmeter] Update=1000 OnRefreshAction=[!CommandMeasure Count "Execute 1"] [Variables] CurN=0 CurS=0 [Count] Measure=Plugin Plugin=ActionTimer ActionList1=Repeat Set1, 5, 10 Set1=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw][!SetVariable CurS "(#CurN#)"][!Update][!Redraw] UpdateDivider=1 DynamicVariables=1 Disabled=0
Capture.PNG
I see now! I supposed that using [!Update] bang in the middle would update the variable during the cycle but I see now that it stays like that for the current cycle and only applied at the end.jsmorley wrote: ↑April 22nd, 2021, 10:53 am Yes. The value of #CurN# is still the old value during the execution cycle, so setting #CurS# to the value of #CurN# during the cycle will always be one update behind. Use this:
Set1=[!SetVariable CurN "(#CurN#+1)"][!SetVariable CurS "(#CurN#+1)"][!Update][!Redraw]
As with all bangs, any #Variables# are evaluated and resolved when the action is first "read" in its entirety.
Code: Select all
[Variables]
CurN=1
CurS=0
CurW=0
N=11
[Count]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Set1, 5, #N# | Wait 5 | Set2
Set1=[!SetVariable CurN "(#CurN#+1)"][!Update][!Redraw][!SetVariable CurS "([ObjIcon#CurN#:W])"][!Update][!Redraw][!SetVariable CurW "(#CurW#+#CurS#)"][!Update][!Redraw]
Set2=[!CommandMeasure Count2 "Execute 1"]
UpdateDivider=1
DynamicVariables=1
Disabled=0
[Count2]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Set3
Set3=[!SetVariable CurW "(#CurW#+#CurS#)"][!Update][!Redraw]
UpdateDivider=1
DynamicVariables=1
Disabled=0