Sign in to follow this  
Followers 0
chriszep

help for a loop

3 posts in this topic

hello i would like this script loop every xx second

;on ferme
WinActivate("SMS-Monitor")
Send("{ALT S}")
Send("{DOWN 2}")
Send("{ENTER}")

;on confirme
WinWaitActive("SMS-Monitor")
Send("{ENTER}")

;on attend 10sec avant de relancer smsmonitor
Sleep(10000)
Run("C:\SMS-Monitor\SMSMntr.exe")

; on attend 30 sec avant de lancer
Sleep(30000)

;clic souris pour lancer le service, pas d'autre solution
MouseClick("left", 452, 68, 1)

I put this at the end but it does not work

While 1
Sleep (50000)
Wend

the time desired for 'sleep' would be in a ini file, is it possible ?

thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try

While 1
;on ferme
WinActivate("SMS-Monitor")
Send("{ALT S}")
Send("{DOWN 2}")
Send("{ENTER}")

;on confirme
WinWaitActive("SMS-Monitor")
Send("{ENTER}")

;on attend 10sec avant de relancer smsmonitor
Sleep(10000)
Run("C:\SMS-Monitor\SMSMntr.exe")

; on attend 30 sec avant de lancer
Sleep(30000)

;clic souris pour lancer le service, pas d'autre solution
MouseClick("left", 452, 68, 1)

Sleep ( 50000 )
Wend

Edit

I would add a hotkey to exit the script or it will loop forever.

Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Dim $Sleep = IniRead('Path to ini', 'Section', 'Key', 'Not Found')

While 1 ; using BigDod's loop example.

Sleep($Sleep)

Edit:

I like Larry's Idea if it is a timed issue, and you can use the ini for that also:

Dim $Reactivate = IniRead('Path to ini', 'Section', 'Key', 'Not Found')

While 1
$time = TimerInit()
;on ferme
    WinActivate("SMS-Monitor")
    Send("{ALT S}")
    Send("{DOWN 2}")
    Send("{ENTER}")
    
;on confirme
    WinWaitActive("SMS-Monitor")
    Send("{ENTER}")
    
;on attend 10sec avant de relancer smsmonitor
    Sleep(10000)
    Run("C:\SMS-Monitor\SMSMntr.exe")
    
; on attend 30 sec avant de lancer
    Sleep(30000)
    
;clic souris pour lancer le service, pas d'autre solution
    MouseClick("left", 452, 68, 1)
    While TimerDiff($time) < $Reactivate; / 1000 allows you to choose seconds / 1000 / 60 is minutes
        Sleep(250)
    WEnd
WEnd
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0