Jump to content

Run a Func every XX minutes


mechtn
 Share

Recommended Posts

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

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

;//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

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
 Share

  • Recently Browsing   0 members

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