AzKay Posted September 20, 2006 Share Posted September 20, 2006 If @HOUR = 2 or 4 or 6 or 8 or 10 or 12 or 14 or 16 or 18 or 20 or 22 or 24 Then _ReLog() Would this work? As in, every 2 hours, it would do the function. Or, Would it call the function even if its like, "4:30" or something? Or not work atall? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
jvanegmond Posted September 20, 2006 Share Posted September 20, 2006 (edited) This will not work. You will need to put it like this:If @hour = 2 Or @hour = 4 Or @hour = 6 ...Edit: I forgot to tell you, you would ofcourse need to loop this. It would probably also call at 4:30 etc.Do you want to call it every 2 hours or just at the whole hour and skip one? Edited September 20, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2006 Author Share Posted September 20, 2006 This will not work. You will need to put it like this: If @hour = 2 Or @hour = 4 Or @hour = 6 ... Edit: I forgot to tell you, you would ofcourse need to loop this. It would probably also call at 4:30 etc. Do you want to call it every 2 hours or just at the whole hour and skip one?Yes, Its in a loop, I want it to call on, every hour. So, at 2am, it would call, then call again at 4am, etc. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
jvanegmond Posted September 20, 2006 Share Posted September 20, 2006 (edited) You will have to wait for 4 PM to check if it works. While 1 If @MIN = 0 Then For $x = 0 to 24 step 2 If @HOUR = $x Then ;call the function. EndIf Next EndIf Sleep(50000) WEnd Edited September 20, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
evilelf Posted September 20, 2006 Share Posted September 20, 2006 say you add this to a bot. U can make it Run for 1 hour or what ever then Sleep tell 1-waht ever time is left for 2 hours. Say this run takes 1 hour and 30 mins. the bot would sleep for 30 mins then rerun. If so i may need this one day on a bot but till this day nice little 2 hour scrip. Link to comment Share on other sites More sharing options...
jvanegmond Posted September 20, 2006 Share Posted September 20, 2006 Yes, but what if the script is dynamic. And one time the run may take 20 seconds and the other it will take 2 hours. The run times would be wrong. github.com/jvanegmond Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2006 Author Share Posted September 20, 2006 You will have to wait for 4 PM to check if it works. While 1 If @MIN = 0 Then For $x = 0 to 24 step 2 If @HOUR = $x Then ;call the function. EndIf Next EndIf Sleep(50000) WEndHmm, I ran it, then changed the PC's time to one minute before 4pm, and, it didnt call. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
BigDod Posted September 20, 2006 Share Posted September 20, 2006 Try reducing the sleep time to 500 Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2006 Author Share Posted September 20, 2006 (edited) I wasnt using sleep time. Ill try adding some x) EDIT:: No difference. EDIT:: My mistake, I had it set as 4:59 Hehe, But now, ill have to change it, because, it does the function every second after it hits 00. Edited September 20, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
BigDod Posted September 20, 2006 Share Posted September 20, 2006 If @MIN = 0 and @SEC = 0 Then Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
AzKay Posted September 20, 2006 Author Share Posted September 20, 2006 If @MIN = 0 and @SEC = 0 Then oÝ÷ Ûú®¢×z1qêm!Øjëh×6 Sleep(500) If @MIN = 0 Then If @SEC = 0 Then For $x = 0 to 24 step 2 If @HOUR = $x Then _ReLog() EndIf Next EndIf EndIf WEnd Well, doesnt really matter, not much difference =P # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
jvanegmond Posted September 20, 2006 Share Posted September 20, 2006 (edited) BigDod's script is faster. With @MIN first. AutoIt checks @min, if this is false @sec is never called. Edited September 21, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
evilelf Posted September 20, 2006 Share Posted September 20, 2006 Yes, but what if the script is dynamic. And one time the run may take 20 seconds and the other it will take 2 hours. The run times would be wrong.Thats why u time your-self say it takes u 1 hour it should take the bot 40 min- 1hour and 15 mins.Pluess u are maken the Scrip so it should work right? You did get this timer working right? Link to comment Share on other sites More sharing options...
jvanegmond Posted September 21, 2006 Share Posted September 21, 2006 I believe, he got this working. However, what your saying could also just be a AdlibEnable with the time parameter called to 2 hours. That's a whole lot easier. github.com/jvanegmond 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