Jump to content

How to write WinWait until "done" been seen for some time period


Recommended Posts

Working with a script that runs some simulations.

Problem is that the script should continue after the text "done" has appear. The main problem is that "done" keeps flashing while the simulations are still running, so the script assumes that they(simulations) are done and continues the procedure, this should not happen.

Question is; How is it possible to make the window wait untill done has been visable for at least 1 sek.

This is the script

ControlClick("SimLight","Calculate",3210) ; Calculate
   WinWait("SimLight","Done") ; Waiting for calculations to be done(This is the problem)
   Sleep(500);
   ControlClick("SimLight","Graph",3223) 

 

Regards

Ivan Nikolaisson

Link to comment
Share on other sites

  • Moderators

ivannikolaisson,

Welcome to the AutoIt forums.

How often does the "Done" flash? I suggest using a loop adjusting your timing so that you stand a good chance of not always hitting the moment when it is visible and then incrementing a counter to get 3 consecutive hits each at least 500ms apart.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@Melba23

Thanks for your reply, a single simulation lasts for around 10 seconds. Within those 10 seconds the done flashes around 20 times. 

I understand your suggestion and it might work. However, I'm running many simulations (around 5000) so there is a chance some of them might be prone to error if I use your suggested method. I would however like to try.

Can you give an example on a counter?

 

Regards 

 

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