Burgs Posted June 23, 2008 Share Posted June 23, 2008 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 More sharing options...
orange Posted June 23, 2008 Share Posted June 23, 2008 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) ;WEndJust have the initial run set on minute 1 and then use a 15 minute timer. Link to comment Share on other sites More sharing options...
Burgs Posted June 23, 2008 Author Share Posted June 23, 2008 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? Link to comment Share on other sites More sharing options...
Burgs Posted June 23, 2008 Author Share Posted June 23, 2008 Oops, make that: If (StringRight(@MIN, 1) = 01) Or (StringRight(@MIN, 1) = 16) Or (StringRight(@MIN, 1) = 31) Or (StringRight(@MIN, 1) = 46) Link to comment Share on other sites More sharing options...
Linux Posted June 23, 2008 Share Posted June 23, 2008 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 More sharing options...
Burgs Posted June 24, 2008 Author Share Posted June 24, 2008 Thank you for your suggestion, I appreciate it! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now