It is currently April 18th, 2024, 6:54 am

Repeated Actions with Variable

Get help with creating, editing & fixing problems with skins
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Repeated Actions with Variable

Post by tass_co »

Hi everyone,

I have a action (open app) and i want to this action repeats with a variable.

How do i?

Code: Select all

[Variables]
TekrarSay1=1

[CalcTekrarSay1]
Measure=Calc
Formula=#TekrarSay1#
IfCondition=(#TekrarSay1#) <=0
IfTrueAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1

[Button]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
                        I want to repeate action but TekrarSay1 times 
LeftMouseUpAction=["#Path1#\EXE\SAVE.mxe"]

MouseScrollUpAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)+1)"]
MouseScrollDownAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)-1)"]
MiddleMouseUpAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1

I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Repeated Actions with Variable

Post by death.crafter »

tass_co wrote: August 13th, 2021, 9:45 pm Hi everyone,

I have a action (open app) and i want to this action repeats with a variable.

How do i?

Code: Select all

[Variables]
TekrarSay1=1

[CalcTekrarSay1]
Measure=Calc
Formula=#TekrarSay1#
IfCondition=(#TekrarSay1#) <=0
IfTrueAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1

[Button]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
                        I want to repeate action but TekrarSay1 times 
LeftMouseUpAction=["#Path1#\EXE\SAVE.mxe"]

MouseScrollUpAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)+1)"]
MouseScrollDownAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)-1)"]
MiddleMouseUpAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1

Use action timer plugin. You'll find it in docs. If you don't understand something in it come back to ask.
from the Realm of Death
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Repeated Actions with Variable

Post by tass_co »

death.crafter wrote: August 13th, 2021, 9:59 pm Use action timer plugin. You'll find it in docs. If you don't understand something in it come back to ask.
Actually i looked and i wrote code but didnt work. Only one time worked and stopped.

Code: Select all


[MeaAction]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SaveFolder,10,#TekrarSay1# | Wait 1000
ActionList2=Repeat ClickTimes,10,#TekrarSay2# | Wait 1000 
SaveFolder=["#Path1#\EXE\SAVE.mxe"][!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"][!UpdateMeter *][!Redraw]
DynamicVariables=1

[Save1]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
LeftMouseUpAction=#UU#[CommandMeasure MeaAction "SaveFolder"]

I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Repeated Actions with Variable

Post by eclectic-tech »

tass_co wrote: August 13th, 2021, 9:45 pm Hi everyone,

I have a action (open app) and i want to this action repeats with a variable.

How do i?
Besides ActionTimer, you could set Updatedivider=-1 in your calc measure [CalcTekrarsay1] so it is only updated with LeftMouseAction in your button meter.

I modified the IfCondition tests to perform the desired action depending on the value of variable 'TekrarSay1'. If that variable is 2, it will perform the action, wait 2 seconds [!Delay 2000], and perform it again. I also added IfConditionMode=1 so the actions are performed on every update.

I use a Clamp function in your mouse scroll to limit the value of 'TekrarSay1' between 1 and 2. You could expand it to any number and add additional IfCondition tests and actions to the calc measure.

TRy this code

Code: Select all

[Variables]
TekrarSay1=1

[CalcTekrarSay1]
Measure=Calc
Formula=#TekrarSay1#
IfCondition=(#TekrarSay1#)=1
IfTrueAction=["#Path1#\EXE\SAVE.mxe"]
IfCondition2=#TekrarSay1#=2
IfTrueAction2=["#Path1#\EXE\SAVE.mxe"][!Delay 2000]["#Path1#\EXE\SAVE.mxe"]
IfConditionMode=1
DynamicVariables=1
UpdateDivider=-1

[Button]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
;                        I want to repeate action but TekrarSay1 times 
LeftMouseUpAction=[!UpdateMeasure CalcTekrarSay1]
;["#Path1#\EXE\SAVE.mxe"]
MouseScrollUpAction=[!SetVariable TekrarSay1 "(Clamp(#TekrarSay1#+1,1,2))"]
MouseScrollDownAction=[!SetVariable TekrarSay1 "(Clamp(#TekrarSay1#-1,1,2))"]
MiddleMouseUpAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Repeated Actions with Variable

Post by tass_co »

eclectic-tech wrote: August 13th, 2021, 10:38 pm Besides ActionTimer, you could set Updatedivider=-1 in your calc measure [CalcTekrarsay1] so it is only updated with LeftMouseAction in your button meter.

I modified the IfCondition tests to perform the desired action depending on the value of variable 'TekrarSay1'. If that variable is 2, it will perform the action, wait 2 seconds [!Delay 2000], and perform it again. I also added IfConditionMode=1 so the actions are performed on every update.

I use a Clamp function in your mouse scroll to limit the value of 'TekrarSay1' between 1 and 2. You could expand it to any number and add additional IfCondition tests and actions to the calc measure.

TRy this code

Code: Select all

[Variables]
TekrarSay1=1

[CalcTekrarSay1]
Measure=Calc
Formula=#TekrarSay1#
IfCondition=(#TekrarSay1#)=1
IfTrueAction=["#Path1#\EXE\SAVE.mxe"]
IfCondition2=#TekrarSay1#=2
IfTrueAction2=["#Path1#\EXE\SAVE.mxe"][!Delay 2000]["#Path1#\EXE\SAVE.mxe"]
IfConditionMode=1
DynamicVariables=1
UpdateDivider=-1

[Button]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
;                        I want to repeate action but TekrarSay1 times 
LeftMouseUpAction=[!UpdateMeasure CalcTekrarSay1]
;["#Path1#\EXE\SAVE.mxe"]
MouseScrollUpAction=[!SetVariable TekrarSay1 "(Clamp(#TekrarSay1#+1,1,2))"]
MouseScrollDownAction=[!SetVariable TekrarSay1 "(Clamp(#TekrarSay1#-1,1,2))"]
MiddleMouseUpAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1
Thank you for the editing. But it is not working properly.
When i refresh skin, action works automatically and works only one time.
I use CalcTekrarSay1 for i dont want to #TekrarSay1# 0.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Repeated Actions with Variable

Post by death.crafter »

tass_co wrote: August 13th, 2021, 10:25 pm Actually i looked and i wrote code but didnt work. Only one time worked and stopped.

Code: Select all


[MeaAction]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SaveFolder,10,#TekrarSay1# | Wait 1000
ActionList2=Repeat ClickTimes,10,#TekrarSay2# | Wait 1000 
SaveFolder=["#Path1#\EXE\SAVE.mxe"][!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"][!UpdateMeter *][!Redraw]
DynamicVariables=1

[Save1]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
LeftMouseUpAction=#UU#[CommandMeasure MeaAction "SaveFolder"]

Have you looked at the docs like once?

Code: Select all

[MeaAction]
Measure=Plugin
Plugin=action timer
ActionList1=Repeat SaveFolder, 1000, #TekrarSay1#
ActionList2=Repeat ClickTimes, 1000, #TekrarSay2#
SaveFolder=["#Path1#\EXE\SAVE.mxe"][!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[Save1]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
LeftMouseUpAction=#UU#[CommandMeasure MeaAction "Execute 1"]
I don't know what #UU# is so I am keeping it intact. If it is action variable from the action timer example remove it. You don't need it here. But you need to update action timer using updatemeasure if you change the TekrarSay1 or 2.
from the Realm of Death
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Repeated Actions with Variable

Post by tass_co »

death.crafter wrote: August 13th, 2021, 11:05 pm Have you looked at the docs like once?

Code: Select all

[MeaAction]
Measure=Plugin
Plugin=action timer
ActionList1=Repeat SaveFolder, 1000, #TekrarSay1#
ActionList2=Repeat ClickTimes, 1000, #TekrarSay2#
SaveFolder=["#Path1#\EXE\SAVE.mxe"][!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[Save1]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
LeftMouseUpAction=#UU#[CommandMeasure MeaAction "Execute 1"]
I don't know what #UU# is so I am keeping it intact. If it is action variable from the action timer example remove it. You don't need it here. But you need to update action timer using updatemeasure if you change the TekrarSay1 or 2.
First of all my english not good. sorry
#UU# a unimportant thing.
This code doesnt work :((

I have a image button and string Meter.
When i use mouse on it, i can arrange to action repeat times (TekrarSay1).
and if i click button, i want to repeat action as much that arranged times.

I dont wanna share all codes.

Code: Select all

[Rainmeter]
OnRefreshAction=#UU#
Update=10

[Variables]
U=[!UpdateMeter *][!Redraw]
UU=[!HideMeterGroup BtnP][!Redraw]
TekrarSay1=1
TekrarSay2=1

[CalcTekrarSay1]
Measure=Calc
Formula=#TekrarSay1#
IfCondition=(#TekrarSay1#) <=0
IfTrueAction=[!SetVariable TekrarSay1 "1"]
IfConditionMode=1
DynamicVariables=1

[MeaAction]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SaveFolder,1000,#TekrarSay1#
ActionList2=Repeat ClickTimes,1000,#TekrarSay2#
SaveFolder=["#Path1#\EXE\SAVE.mxe"];[!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"];[!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[Save1]
Meter=BUTTON
x=26
y=60
ButtonImage=#image5#
LeftMouseUpAction=#UU#[CommandMeasure MeaAction "Execute 1"]
MouseScrollUpAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)+1)"][!UpdateMeasure MeaAction]
MouseScrollDownAction=[!SetVariable TekrarSay1 "((#TekrarSay1#)-1)"][!UpdateMeasure MeaAction]
MiddleMouseUpAction=[!SetVariable TekrarSay1 "1"]
DynamicVariables=1
Group=BtnP

You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Repeated Actions with Variable

Post by eclectic-tech »

tass_co wrote: August 13th, 2021, 10:53 pm Thank you for the editing. But it is not working properly.
When i refresh skin, action works automatically and works only one time.
I use CalcTekrarSay1 for i dont want to #TekrarSay1# 0.
What is not working?
You need to be precise in what you want to happen; according to your first code, you wanted to run the exe based on if the variable was 1 or 2 that many times...
The code does that; if you didn't want it to run the first time, set the variable to 0 to start.

Hopefully death.crafter's suggestion is easier for you...

EDIT: I just saw your latest post and will look at that.
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Repeated Actions with Variable

Post by tass_co »

I tired you so much guys. sorry that

EDIT:

Sorry guys. I had a text meter and i forgot to share with you.
ActionTimer codes never worked.
When i disabled this string meter, i realize to codes didnt working
I looked all the examples on the internet and couldn't find such an example.
I guess ActionTimer doesnt work with external files.
I don't know where i going from here, but i promise it won't be boring... :great:
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Repeated Actions with Variable

Post by death.crafter »

tass_co wrote: August 13th, 2021, 11:21 pm
[MeaAction]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SaveFolder,1000,#TekrarSay1#
ActionList2=Repeat ClickTimes,1000,#TekrarSay2#
SaveFolder=["#Path1#\EXE\SAVE.mxe"];[!UpdateMeter *][!Redraw]
ClickTimes=["#Path1#\EXE\GoodNext.mxe"];[!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1
from the Realm of Death