mechtn Posted October 21, 2009 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
Demonic Posted October 21, 2009 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.
Mison Posted October 21, 2009 Posted October 21, 2009 or you could use TimerInit & TimerDiff. Wow, you already have 3 solutions Hi ;)
mechtn Posted October 21, 2009 Author 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!
anixon Posted October 21, 2009 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
anixon Posted October 21, 2009 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
mechtn Posted October 21, 2009 Author Posted October 21, 2009 thanks for the sample code... i'll play with it in the morning...
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