It is currently March 28th, 2024, 7:51 pm

ActionTimer

Share and get help with Plugins and Addons
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: ActionTimer 0.1 [Beta]

Post by Brian »

This plugin has been updated, check the first post for the latest:
http://rainmeter.net/forum/viewtopic.php?p=112669#p112669


With the latest Rainmeter beta released today, it is important to update this plugin as soon as possible. There was a problem in some cases where the 'FinishAction' from some plugins were not firing (or doing strange things). This problem was caused by a change to the Rainmeter API that I made to get ActionTimer working. Since we fixed the part on the Rainmeter end, I had to come up with something to make ActionTimer work again....so this is it.

Anyway...

So, I finally got a little time to add a feature to this plugin. It is the 'Repeat' command that makes it really simple to define an action and wait sequence a number of times.

Usage: ActionList1= ... | Repeat SomeAction, WaitTime, NumberOfRepeats | ....
Where WaitTime is the number of milliseconds you want to wait in between each action, and NumberOfRepeats is 'how many' times you want to repeat that command.

Basically, it shortens the code significantly when doing a repetitive action/wait sequence.

Enjoy!

-Brian
cfixd
Posts: 31
Joined: September 1st, 2014, 1:38 am

Re: ActionTimer 0.1 [Beta]

Post by cfixd »

Brian wrote: So, I finally got a little time to add a feature to this plugin. It is the 'Repeat' command that makes it really simple to define an action and wait sequence a number of times.
:D Glad to see it.I really need this feature, now I can write skins with the plugin in a easier way.

By the way, is it possible to "rename" the ActionListN ?
e.g.
ActionList1Name=ShowTip
then "Execute 1" equals to "Execute ShowTip"
I think it's useful to make the meaning of command clear between skins, just something like API.
Of course it doesn't matters a lot, just an idea.

I really love the 'Repeat' command, hoping it won't cause problems in Rainmeter.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: ActionTimer 0.1 [Beta]

Post by Brian »

cfixd wrote:By the way, is it possible to "rename" the ActionListN ?
e.g.
ActionList1Name=ShowTip
then "Execute 1" equals to "Execute ShowTip"
Without changes to the plugin API, this unfortunately cannot be done. There needs to be a way for the plugin to ask Rainmeter what the value of an option is. So basically, the plugin needs to have at least 1 hardcoded option. From there, you can use that hardcoded option to define the other options to read, which is what I did for this plugin.

-Brian
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: ActionTimer 0.1 [Beta]

Post by ikarus1969 »

Just a short feedback: i've played around with ActionTimer to make a transition in my weather-skin when temperature changes:
Temperature-transition_with_ActionTimer.gif
or a skin where i show the time in words:
time-in-words-transition_with_ActionTimer.gif
I hope this Plugin will find its way someday into the Rainmeter-package as a built-in measure.
You do not have the required permissions to view the files attached to this post.
drakulaboy
Posts: 165
Joined: June 29th, 2014, 8:35 pm

Re: ActionTimer 0.1 [Beta]

Post by drakulaboy »

@ikarus1969 can you post a little examle please :welcome:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ActionTimer 0.1 [Beta]

Post by jsmorley »

Updated the .rmskin in the First Post to use the new "Repeat" functionality.
drakulaboy
Posts: 165
Joined: June 29th, 2014, 8:35 pm

Re: ActionTimer 0.1 [Beta]

Post by drakulaboy »

nice, this is what i need now :bow:
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: ActionTimer 0.1 [Beta]

Post by ikarus1969 »

drakulaboy wrote:@ikarus1969 can you post a little examle please :welcome:
Sure:
AT Test weather.gif
Test ActionTimer_1.0.rmskin

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
OnWakeAction=[!Refresh]

[Metadata]
Author=ikarus1969
Name=WeatherExample
Description=Example for the use of the ActionTimer plugin.|It is used when the temperature or the weather description changes
Instructions=No instructions so far
Version=1
License=Public Domain

[Variables]
V_DESC=get weather...
V_DESC_ALPHA=255
V_DESC_FE_ALPHA=192
UAT_DESC=[!UpdateMeasure "Measure_AT_Description"][!UpdateMeter "Meter_Description_Current"][!Redraw]

; V_TEMP=…
V_TEMP=
V_TEMP_ALPHA=255
UAT_TEMP=[!UpdateMeasure "Measure_AT_Temperature"][!UpdateMeter "Meter_Temp_Current"][!Redraw]

@IncludeJSMorleyWDC="WeatherDotComRegExp.inc"

; --------
; Measures
; --------
[Measure_AT_Description]
Measure=PLUGIN
Plugin=ActionTimer
ActionList1=Repeat HideDM, 20, 51 | Wait 10 | RefreshVarDM | Wait 10 | Repeat ShowDM, 20, 51
HideDM=[!SetVariable "V_DESC_ALPHA" "(#V_DESC_ALPHA# - 5)"]#UAT_DESC#
RefreshVarDM=[!SetVariable "V_DESC" "[Measure_Current_Text]"]
ShowDM=[!SetVariable "V_DESC_ALPHA" "(#V_DESC_ALPHA# + 5)"]#UAT_DESC#
DynamicVariables=1
UpdateDivider=-1
IgnoreWarnings=1

[Measure_AT_Temperature]
Measure=PLUGIN
Plugin=ActionTimer
ActionList1=Repeat HideTM, 20, 51 | Wait 10 | RefreshVarTM | Wait 10 | Repeat ShowTM, 20, 51
HideTM=[!SetVariable "V_TEMP_ALPHA" "(#V_TEMP_ALPHA# - 5)"]#UAT_TEMP#
RefreshVarTM=[!SetVariable "V_TEMP" "[Measure_Current_Temperature]"][!SetOption "Meter_Temp_Current" "Postfix" "°[Measure_Units_Temperature]"]
ShowTM=[!SetVariable "V_TEMP_ALPHA" "(#V_TEMP_ALPHA# + 5)"]#UAT_TEMP#
DynamicVariables=1
UpdateDivider=-1
IgnoreWarnings=1


; -----------------------------
; weather-data from weather.com
; -----------------------------
[Measure_Weather_wdc]
Measure=PLUGIN
Plugin=WebParser.dll
UpdateRate=300
Url="http://xml.weather.com/weather/local/USVA0527?cc=*&unit=F&dayf=6"
RegExp=(?siU)^(.*)$

; -- units
[Measure_UnitsOfMeasure]
Measure=Plugin
Plugin=WebParser.dll
URL=[Measure_Weather_wdc]
RegExp=#wdc_UnitsOfMeasure#
DynamicVariables=1

[Measure_Units_Temperature]
Measure=Plugin
Plugin=WebParser
URL=[Measure_UnitsOfMeasure]
StringIndex=3
DynamicVariables=1

; -- location
[Measure_Location]
Measure=Plugin
Plugin=WebParser.dll
URL=[Measure_Weather_wdc]
RegExp=#wdc_Location#
DynamicVariables=1

[Measure_Location_DNam]
Measure=Plugin
Plugin=WebParser
URL=[Measure_Location]
StringIndex=2
DynamicVariables=1
OnChangeAction=[!SetOption "Meter_Location_Name" "Text" "%1"]
; -- end of location


; -- current conditions
[Measure_CurrentConditions]
Measure=Plugin
Plugin=WebParser.dll
URL=[Measure_Weather_wdc]
RegExp=#wdc_CurrentConditions#
DynamicVariables=1

[Measure_Current_Temperature]
Measure=Plugin
Plugin=WebParser
URL=[Measure_CurrentConditions]
StringIndex=3
DynamicVariables=1
OnChangeAction=[!CommandMeasure "Measure_AT_Temperature" "Execute 1"]

[Measure_Current_Text]
Measure=Plugin
Plugin=WebParser
URL=[Measure_CurrentConditions]
StringIndex=5
DynamicVariables=1
RegExpSubstitute=1
Substitute=#Subst.WDesc#","#Subst.WDescPost#","(.)$":"\1 bei "
OnChangeAction=[!CommandMeasure "Measure_AT_Description" "Execute 1"]
; -- end of current conditions


; Meters
; -------------------------------
[Meter_BG]
Meter=IMAGE
X=#WORKAREAX#
Y=#WORKAREAY#
W=(40 + MAX([Meter_Location_Name:W], ([Meter_Description_Current:W] + 40 + [Meter_Temp_Current:W])))
H=(40 + [Meter_Location_Name:H] + 10 + [Meter_Description_Current:H])
SolidColor=E9E9CFFF
DynamicVariables=1


; --------------
; Weather meters
; --------------
[Meter_Location_Name]
Meter=STRING
MeasureName=Measure_Location_DNam
Text="get location..."
X=20r
Y=20r
InlineSetting=Face | Arial
InlinePattern=.*
InlineSetting2=Size | 32
InlinePattern2=.*
InlineSetting3=Color | 004080FF
InlinePattern3=.*
AntiAlias=1
DynamicVariables=1

[Meter_Description_Current]
Meter=STRING
Text="#V_DESC#"
X=([Meter_BG:X] + 20)
Y=([Meter_Location_Name:Y] + [Meter_Location_Name:H] + 10)
InlineSetting=Size | 24
InlinePattern=.*
InlineSetting2=Color | 0,128,0,#V_DESC_ALPHA#
InlinePattern2=.*
AntiAlias=1
DynamicVariables=1

[Meter_Temp_Current]
Meter=STRING
Text="#V_TEMP#"
X=40R
Y=0r
InlineSetting=Size | 24
InlinePattern=.*
InlineSetting2=Color | 80,0,0,#V_TEMP_ALPHA#
InlinePattern2=.*
InlineSetting3=Size | 24
InlinePattern3=°.
AntiAlias=1
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: ActionTimer 0.1 [Beta]

Post by Active Colors »

It would be more convenient if instead of having each Execute and Stop actions separated we could define preferable range of actions like [!CommandMeasure MyMeasure1 "Execute 1-9"] or [!CommandMeasure MyMeasure2 "Stop 12-25"].
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: ActionTimer 0.1 [Beta]

Post by Brian »

Active Colors wrote:It would be more convenient if instead of having each Execute and Stop actions separated we could define preferable range of actions like [!CommandMeasure MyMeasure1 "Execute 1-9"] or [!CommandMeasure MyMeasure2 "Stop 12-25"].
I had originally thought adding this option to the plugin, however, I came to the conclusion that it was not a good fit mainly because I want to discourage users/authors from 'over-using' the plugin for animation. The problem is, this plugin can really tie up Rainmeter and slow it down to a crawl when doing too much at the same time - especially with any redrawing of any skin. This is also why I do not (and will not) support any sort of endless loop capability in this plugin (at least until Rainmeter itself can handle it).

So basically what I am saying is, the plugin isn't really meant to handle so many different threads at the same time all telling Rainmeter to do something outside of its normal function. Rainmeter just wasn't designed that way. It is meant to do things sequentially. While some systems will be just fine with the extra overhead of what this plugin can cause - some systems will not do well under the same conditions.

-Brian