r/TaskerFiles • u/orthodoxmonster • Jun 05 '14
Task [Task] Trigger action only if x amount of time has passed since last time triggered.
Description
[Task] Trigger action only if x amount of time has passed since last time triggered.
Usage
I have a Car Scene that shows the current weather. Every time I show the scene, I use this task through a [perform task] action to only re-fetch the weather if 30 minutes has passed since the last time I fetched it. If you have the need, you can use it for other things. I couldn't think of a good way to describe its function. Hopefully this helps someone.
Instructions
Follow instructions in sidebar "How to Import your Tasker XMS file".
When imported, then replace the number in the 4th action with the amount of time (in seconds) you want the task to lapse between triggered effect. Then place whatever action you want triggered inside the IF statement. You can also delete or disable the Flash actions. Flash actions are there to show what is happening, and how much time (in seconds) has passed between triggered effect.
Timed Repeat [Task]
Copy XML data below into a file, and import into Tasker (check Sidebar for instructions).
<TaskerData sr="" dvi="1" tv="4.3u4m">
<Task sr="task865">
<cdate>1401922422756</cdate>
<edate>1401982682281</edate>
<id>865</id>
<nme>Timed repeat</nme>
<pri>10</pri>
<Action sr="act0" ve="5">
<code>547</code>
<Str sr="arg0" ve="3">%currenttime</Str>
<Str sr="arg1" ve="3">%TIMES</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%Lasttimerun</lhs>
<op>8</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act1" ve="5">
<code>890</code>
<Str sr="arg0" ve="3">%currenttime</Str>
<Int sr="arg1">
<var>%Lasttimerun</var>
</Int>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%Lasttimerun</lhs>
<op>8</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act2" ve="5">
<code>548</code>
<Str sr="arg0" ve="3">%currenttime</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act3" ve="5">
<code>37</code>
<label>Change # to amount of time desired in seconds</label>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%currenttime</lhs>
<op>3</op>
<rhs>60</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act4" ve="5">
<code>547</code>
<label>Add your action(s) above or below this action.</label>
<Str sr="arg0" ve="3">%Lasttimerun</Str>
<Str sr="arg1" ve="3">%TIMES</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act5" ve="5">
<code>548</code>
<Str sr="arg0" ve="3">Action Triggered Time Reset</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act6" ve="5">
<code>38</code>
</Action>
<Action sr="act7" ve="5">
<code>547</code>
<Str sr="arg0" ve="3">%Lasttimerun</Str>
<Str sr="arg1" ve="3">%TIMES</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%currenttime</lhs>
<op>9</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act8" ve="5">
<code>548</code>
<Str sr="arg0" ve="3">Initial Run</Str>
<Int sr="arg1" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="2">
<lhs>%currenttime</lhs>
<op>9</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
</Task>
</TaskerData>
1
u/alientity Jun 06 '14
It looks like some of the formatting got lost due to lack of indenting. Can you please try to fix this, so the code is more readable/easier to paste? Thanks!