It is currently April 27th, 2024, 5:34 am

Weekly timer reset / run operation once weekly

Get help with creating, editing & fixing problems with skins
naljubes
Posts: 8
Joined: September 17th, 2012, 3:06 am

Weekly timer reset / run operation once weekly

Post by naljubes »

Hi

I have a widget that I use to monitor my bandwidth usage. I want the week section to reset on Monday at midnight. The script currently resets on the specific date and time.
Here is a piece of the code:

Code: Select all

[CheckReset1]
Measure=Calc
Formula=GetDate=31?(GetHour=0?(GetMinute=0?(GetSecond=1?(-2):(-1)):(-1)):(-1)):(-1)
IfEqualValue=(-2)
IfEqualAction=[!WriteKeyValue Variables RefreshValue5 [MeasureNetInTotal]][!Refresh][!WriteKeyValue Variables RefreshValue6 [MeasureNetOutTotal]][!Refresh]
Can I put a day into IfEqualValue? say..
Formula= . . .
IfEqualValue=Monday
IfEqualValue=(-2)
IfEqualAction= . . .

Maybe there is a better way to do this? Basically, it just needs to fire the command every monday at 12:00am

Thank you:)
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Weekly timer reset / run operation once weekly

Post by smurfier »

Code: Select all

[Time]
Measure=Time
Format=(%w=1)&&(%H=0)&&(%S=0)

[Calc]
Measure=Calc
Formula=[Time]
DynamicVariables=1
IfAboveValue=0
IfAboveAction=[!WriteKeyValue Variables RefreshValue5 [MeasureNetInTotal]][!WriteKeyValue Variables RefreshValue6 [MeasureNetOutTotal]][!Refresh]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
naljubes
Posts: 8
Joined: September 17th, 2012, 3:06 am

Re: Weekly timer reset / run operation once weekly

Post by naljubes »

Ohh. Thank you for the fast reply! :D