Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

Hmm, thanks but I'm not sure what you mean. Should I change the the line after the "While" line to:

If (StringRight(@MIN, 1) = 16) Or (StringRight(@MIN, 1) = 46) ??

Would that work?

Posted

Oops, make that:

If (StringRight(@MIN, 1) = 01) Or (StringRight(@MIN, 1) = 16) Or (StringRight(@MIN, 1) = 31) Or (StringRight(@MIN, 1) = 46)

Posted

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!"

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
  • Recently Browsing   0 members

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