Jump to content

UDF-Sleep until ready


Walkabout
 Share

Recommended Posts

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.

Enjoy!

Walkabout

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
;\Tweak

   $Count = 0
   AutoItSetOption("MouseCoordMode",0)


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

   sleep($StartWait)
   while $Count <= $WaitIterations

     sleep($WaitInterval)
     MouseMove("220","165","0")
     if MouseGetCursor()<>14 then
        $Count = $Count + 1
     Else
        $Count = 0
     EndIf
   Wend
   Sleep($EndWait)
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...