It is currently April 19th, 2024, 6:34 am

How do I: Execute some code *10 seconds* after an Action?

Get help with creating, editing & fixing problems with skins
shiish
Posts: 3
Joined: April 4th, 2010, 5:30 am

How do I: Execute some code *10 seconds* after an Action?

Post by shiish »

Hi there, i was wanting to make a skin execute the code below 10 seconds after a 'LeftMouseDownAction' has been performed.. is that possible? if so, how?

Here's the code i want to execute 10 seconds after a 'LeftMouseDownAction' has been performed

Code: Select all

!execute #HIDECONTENTS#[!RainmeterHideMeter OpenText2][!RainmeterHideMeter (close)][!RainmeterEnableMeasure HOLD][!RainmeterEnableMeasure REVERSE][!RainmeterShowMeter (reverse)][!RainmeterHideMeter (opened)][!RainmeterShowMeter OpenText] 

I would like to execute the ^above^ code 10 seconds afer this code has been executed:

Code: Select all

[FirstShortcut]
Meter=IMAGE
ImageName=#FirstIcon#
X=43
Y=29
Hidden=1
H=32
LeftMouseDownAction=!Execute ["#FirstShortcut#"][!RainmeterRedraw]

i tried to use [MeasureExecuteUpdate] but failed miserably lol..
Thanks, hopefully my explanation was clear .. *also attached the .ini file*
You do not have the required permissions to view the files attached to this post.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: How do I: Execute some code *10 seconds* after an Action?

Post by Alex2539 »

First things first, that skin has an update of 1. That is WAY too often. If you really need a quick update, you should try and have it at 100 as a minimum.

As for the delay, you're going to first want to add a measure like this:

Code: Select all

[Measure10Sec]
Measure=Calc
Formula=Measure10Sec+1
IfAboveValue=99
IfAboveAction=!execute #HIDECONTENTS#[!RainmeterHideMeter OpenText2][!RainmeterHideMeter (close)][!RainmeterEnableMeasure HOLD][!RainmeterEnableMeasure REVERSE][!RainmeterShowMeter (reverse)][!RainmeterHideMeter (opened)][!RainmeterShowMeter OpenText][!RainmeterDisableMeasure Measure10Sec]
Disabled=1
Once it's enabled, it will count up from zero. If you set the update to 100, then this measure should take 10 seconds to reach a value of 100. Once it does, it will perform all of your actions, then disable itself. Then on the meter with the mouse action, all you need to do is enable that measure:

Code: Select all

[FirstShortcut]
Meter=IMAGE
ImageName=#FirstIcon#
X=43
Y=29
Hidden=1
H=32
LeftMouseDownAction=!Execute ["#FirstShortcut#"][!RainmeterEnableMeasure Measure10Sec][!RainmeterRedraw]
That should do it.
ImageImageImageImage
shiish
Posts: 3
Joined: April 4th, 2010, 5:30 am

Re: How do I: Execute some code *10 seconds* after an Action?

Post by shiish »

wow thanks man, that works perfectly., i really appreciate it :thumbsu:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How do I: Execute some code *10 seconds* after an Action?

Post by jsmorley »

At an Update of 1, you will no longer have a "computer", but rather a "Rainmeter Appliance". ;-)