It is currently November 29th, 2020, 7:47 pm

Delay a action

Help with creating, editing & fixing problems with skins
fediafedia
Posts: 36
Joined: April 13th, 2009, 12:40 am

Delay a action

Post by fediafedia »

Hello, I'm not sure if this is possible, but I want to delay a sequence of actions via !execute so they dont happen all at once. Does anybody know how to do that?
User avatar
maminscris
Posts: 522
Joined: April 24th, 2009, 3:17 pm
Location: Bucharest, Romania Lat 44,43° Lon 26,1°

Re: Delay a action

Post by maminscris »

you could try using a calc formula

[somemeasure]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=!Execute
Zero at programing, zero at writing codes, so far 2 at making images
But I'm good at copy/paste, and I not always like this
Image
fediafedia
Posts: 36
Joined: April 13th, 2009, 12:40 am

Re: Delay a action

Post by fediafedia »

Thanks for the reply, that method didnt work but i found another one:

[somemeasure]
Measure=Calc
Formula=Counter % 100
Substitute=".00000":""
IfEqualValue=1
IfEqualAction=PLAY #CURRENTPATH#piano\12.wav

[somemeasure2]
Measure=Calc
Formula=Counter % 100
Substitute=".00000":""
IfEqualValue=2
IfEqualAction=PLAY #CURRENTPATH#piano\10.wav

[somemeasure3]
Measure=Calc
Formula=Counter % 100
Substitute=".00000":""
IfEqualValue=3
IfEqualAction=PLAY #CURRENTPATH#piano\9.wav

Unfortunately the result wasnt satisfactory so i dropped this idea.
User avatar
kenz0
Developer
Posts: 264
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: Delay a action

Post by kenz0 »

If started "Counter", it cannot be reset until being restarted skin, and "Counter" will not start from 0 even if the skin is refreshed. This means this command is effective only the first once. And it would not be possible to use that repeatedly.
So I think that the feature of this "Counter" is not suitable for the solution of this request.

Now, the following examples count up without using "Counter". But basic approach is similar to yours. I suggest this solution.

Code: Select all

[MeasureDelay_5Sec]
Measure=Calc
Formula=MeasureDelay_5Sec + 1
IfEqualValue=5
IfEqualAction=!Execute [notepad][!RainmeterDisableMeasure MeasureDelay_5Sec]
Disabled=1

[MeasureDelay_10Sec]
Measure=Calc
Formula=MeasureDelay_10Sec + 1
IfEqualValue=10
IfEqualAction=!Execute [cmd][!RainmeterDisableMeasure MeasureDelay_10Sec]
Disabled=1

[MeasureDelay_15Sec]
Measure=Calc
Formula=MeasureDelay_15Sec + 1
IfEqualValue=15
IfEqualAction=!Execute [calc][!RainmeterDisableMeasure MeasureDelay_15Sec]
Disabled=1

[MeterAction]
Meter=STRING
W=100
H=20
FontSize=12
SolidColor=FFFFFF
Text=Action!
LeftMouseDownAction=!Execute [!RainmeterEnableMeasure MeasureDelay_5Sec][!RainmeterEnableMeasure MeasureDelay_10Sec][!RainmeterEnableMeasure MeasureDelay_15Sec]
_____________________________________

EDIT:
If your request is just to execute some actions continuously at intervals of one second, the following relay method is easier.

Code: Select all

[MeasureDelay1]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=!Execute [notepad][!RainmeterEnableMeasure MeasureDelay2][!RainmeterDisableMeasure MeasureDelay1]
Disabled=1

[MeasureDelay2]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=!Execute [cmd][!RainmeterEnableMeasure MeasureDelay3][!RainmeterDisableMeasure MeasureDelay2]
Disabled=1

[MeasureDelay3]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=!Execute [calc][!RainmeterDisableMeasure MeasureDelay3]
Disabled=1

[MeterAction]
Meter=STRING
W=100
H=20
FontSize=12
SolidColor=FFFFFF
Text=Action!
LeftMouseDownAction=!Execute [!RainmeterEnableMeasure MeasureDelay1]
.
Image