mechtn Posted October 21, 2009 Share Posted October 21, 2009 Hello, I'm a new AutoIT user who has just converted from using AcTool. I have a basic question about how to do something in AutoIT that I was able to do in AcTool. In AcTool I could run a procedure (func in autoit) every XX minutes fairly easily. Using ProcessMessages in my main while loop checks all Procedures and makes them go off every XX minutes AcTool's version would be... Procedure Test Every 15 minutes //stuff goes here End While 1=1 ProcessMessages End Now with AutoIt i know that I would have... Func Test() ;~ stuff goes here EndFunc While 1=1 ;~ not sure what to do here WEnd I know I could put Test() in my while statement to call it but I don't know how to make it do it every XX minutes. Does this make sense? Can anyone please point me in the right direction? Thanks kindly. mechtn Link to comment Share on other sites More sharing options...
Demonic Posted October 21, 2009 Share Posted October 21, 2009 Use a Sleep() call in your loop, or use TimerInit at the start of the timer and check for when your ammount of time has elapsed. Link to comment Share on other sites More sharing options...
omikron48 Posted October 21, 2009 Share Posted October 21, 2009 You could try using AdlibEnable . Link to comment Share on other sites More sharing options...
Mison Posted October 21, 2009 Share Posted October 21, 2009 or you could use TimerInit & TimerDiff. Wow, you already have 3 solutions Hi ;) Link to comment Share on other sites More sharing options...
mechtn Posted October 21, 2009 Author Share Posted October 21, 2009 Thanks guys. I'll look in to all of the above and find the best solution for my program. AutoIt rocks! Link to comment Share on other sites More sharing options...
anixon Posted October 21, 2009 Share Posted October 21, 2009 Hello, I'm a new AutoIT user who has just converted from using AcTool. I have a basic question about how to do something in AutoIT that I was able to do in AcTool.In AcTool I could run a procedure (func in autoit) every XX minutes fairly easily. Using ProcessMessages in my main while loop checks all Procedures and makes them go off every XX minutesAcTool's version would be...Procedure Test Every 15 minutes//stuff goes hereEndWhile 1=1ProcessMessagesEndNow with AutoIt i know that I would have...Func Test();~ stuff goes hereEndFuncWhile 1=1;~ not sure what to do hereWEndI know I could put Test() in my while statement to call it but I don't know how to make it do it every XX minutes.Does this make sense? Can anyone please point me in the right direction?Thanks kindly.mechtn Link to comment Share on other sites More sharing options...
anixon Posted October 21, 2009 Share Posted October 21, 2009 ;//Timer ;//Call the Loop _Loop() Func _Loop() While 1 ;//Stop Processing for nn Minutes _Timer() ;On return do Something WEnd EndFunc ;//Timer Func _Timer() Local $EndMenuTimer = 50000 ;//Time Variable $MenuCycle = _TimeToTicks(@HOUR, @MIN, @SEC) $MenuEndCycle = $MenuCycle + $EndMenuTimer While 1 ;//Exit Time after If _TimeToTicks(@HOUR, @MIN, @SEC) >= $MenuEndCycle Then ;//Return to Loop ExitLoop EndIf ;//Pause Processing Sleep(1000) WEnd EndFunc Link to comment Share on other sites More sharing options...
mechtn Posted October 21, 2009 Author Share Posted October 21, 2009 thanks for the sample code... i'll play with it in the morning... 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