Jump to content

Change to 15 minutes


Recommended Posts

Greetings,

I've got the following script below that runs a program every 5 minutes beginning when the minute ends with a "1" or a "6" (so it runs every "5 + 1" minutes). This works fine. I need to re-work it so it runs exactly the same way however on each 15 minute timeframe. Thus I need it to run every 15 minutes on the "1" and "6" minute marks...possible? It should be fairly easy but I can't get my head around it. Thank you in advance.

While 1

If (StringRight(@MIN, 1) = 1) Or (StringRight(@MIN, 1) = 6) Then ;if current minute ends in 1 or 6

;run program here

Run("C:\SegFiles\Process.exe", "", @SW_MAXIMIZE)

;$Control = 1

Sleep(60000)

EndIf

Sleep(10) ;

WEnd

Link to comment
Share on other sites

Greetings,

I've got the following script below that runs a program every 5 minutes beginning when the minute ends with a "1" or a "6" (so it runs every "5 + 1" minutes). This works fine. I need to re-work it so it runs exactly the same way however on each 15 minute timeframe. Thus I need it to run every 15 minutes on the "1" and "6" minute marks...possible? It should be fairly easy but I can't get my head around it. Thank you in advance.

While 1

If (StringRight(@MIN, 1) = 1) Or (StringRight(@MIN, 1) = 6) Then ;if current minute ends in 1 or 6

;run program here

Run("C:\SegFiles\Process.exe", "", @SW_MAXIMIZE)

;$Control = 1

Sleep(60000)

EndIf

Sleep(10) ;

WEnd

Just have the initial run set on minute 1 and then use a 15 minute timer.

Link to comment
Share on other sites

Global $counter = 3

While 1

If (StringRight(@MIN, 1) = "1") Or (StringRight(@MIN, 1) = "6" ) Then ;if current minute ends in 1 or 6

$counter += 1

if $counter >= 3 then

;run program here

Run("C:\SegFiles\Process.exe", "", @SW_MAXIMIZE)

;$Control = 1

Sleep(60000)

$counter = 0

endif

EndIf

Sleep(10) ;

WEnd

added a counter. if counter >= 3 times 5 minutes then execute.

should alternate "1" and "6"

not tested

You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...