Jump to content

help with random time


Recommended Posts

hy,i have a crapy video conversion program that needs always some butons to be presed after the conversion is done and to start the next video

i made 1 code for it but i dont know how to ad to it random time delay between the functions(some movies takes longer some smaler amount of time)

the first function is ok,starts the program to convert but the problem apears that where i cant get it to pres the ready and start the second func because of the random time of the conversion

here is my code

HotKeySet("{ENTER}", "first")

While 1
Sleep(100)
WEnd

Func first()
Send("{F2 DOWN}")
While 1
$pix = PixelSearch(x, y, x, y, color, color variation)

If Not @error Then
Sleep(300)
Send("{F2 UP}")
Call("second")
EndIf

WEnd


EndFunc ;==>first

Func second()
Send("{F6 DOWN}")

While 1

$pix = PixelSearch(x, y, x, y, color, color variation)

If Not @error Then
Sleep(300)
Send("{F6 UP}")
Call("first")
EndIf

WEnd
Link to comment
Share on other sites

:guitar: Does your program have a progress bar? If so, then there is no need to sleep(). You could just poll the progress percentage using ControlGetText(). Once it reaches 100%, execute your commands...

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

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...