Sign in to follow this  
Followers 0

UDF-Sleep until ready

1 post in this topic

One of the big annoyances about using tools like AutoIt3 or Dataload to upload data to many applications (particularly client-server apps) is that the app will often pause for exended periods randomly. Increasing the length of the sleep()s can be inefficient because it can significantly increase the time to do the total upload. I wrote this script to 'wait until ready' by checking the status of the cursor when interacting with Oracle Applications. I think for other applications the result returned by MouseGetCursor might need to be modified.



Func _OracleWait($OracleName)
;This function waits until Oracle Applications is ready by checking the cursor status.

Local $StartWait
Local $EndWait
Local $WaitInterval
Local $WaitIterations

Dim $Count

;Tweak here
   $StartWait = 500 
   $EndWait = 750
   $WaitInterval = 100
   $WaitIterations = 15

   $Count = 0

   If Not WinActive($OracleName,"") Then WinActivate($OracleName,"")

   while $Count <= $WaitIterations

     if MouseGetCursor()<>14 then
        $Count = $Count + 1
        $Count = 0

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