Jump to content

Wait Until Status Message Changes ..?


Recommended Posts

How do I cause the script to wait for an on-screen message to change.

I have a client application that logs into a server, there is a status message on screen which cycles through "Not Connected", "Attempting to Connect to IP: XxXXXX", "Connecting..." and finally "Connected".

I want the script to pause/wait until the "Connected" status appears..

Any ideas?

Cheers

Dave

Link to comment
Share on other sites

  • Moderators

How do I cause the script to wait for an on-screen message to change.

I have a client application that logs into a server, there is a status message on screen which cycles through "Not Connected", "Attempting to Connect to IP: XxXXXX", "Connecting..." and finally "Connected".

I want the script to pause/wait until the "Connected" status appears..

Any ideas?

Cheers

Dave

I would start by trying out this script. It will return all the ClassNameNN's by their text. Then you should be able to use ControlCommand() to read the text to see if it matches what you want. Edited by big_daddy
Link to comment
Share on other sites

Ok, got it working.

Predictably, I have hit another wall... :think:

Bit of a weird setup here.. The text is actually a combo box trigger showing connection status (you can drop it down and choose Busy, Inactive, Away etc), however, when the application is logging in this area just shows a status message (i.e. Connecting to IP: ...) - this status message is not an option in the combo box, and when you click it the combo box opens with all options greyed out.

Anyways - the long and short of it is that the text "Connected" text, does not appear in the readout of the Find Classes script. I'm guessing it may be a 'Container' ..??

I've included some screenshots, hopefully this will make the problem a little clearer

AutoScript_A.JPG shows the application logging in. You can see towards the top left it is logging into an IP address. This is the combo box trigger...

AutoScript_B.JPG shows the greyed out combo box - the application has not logged in yet.

AutoScript_C.JPG shows the application logged in. The text has changed to 'Connected' - this is an option in the combo box which is now available.

Depending on network load etc, it can take a varying amount of time to get to this point. It is at this point that I want to script to carry on the automation, but not before.

You see my dilemma?

Thanks v.much for your help so far, I appreciate it a lot.

Cheers

Dave

Edited by DaveToland
Link to comment
Share on other sites

I initially thought that the MAINWINDOW_STATUS_CONNECTED2 would not help as it says this whatever the status, although during login this text actually reads MAINWINDOW_STATUS_REGISTERING

So, I think it will work if I continue the script when this changes from REGISTERING to CONNECTED2.

I have had a read through the helpfile for 'ControlCommand' but I cannot work out what I should do.

Do I use the "FindString" command?

Sorry to be a pain.... :think:

Dave

Link to comment
Share on other sites

I tried this:

Do

$cmd = ControlCommand ("Ingenious", "", 5230, "FindString", "MAINWINDOW_STATUS_CONNECTED2")

Until $cmd <> 0

MsgBox(0, "Message", $cmd)

but it doesn't ever show the message, even when it is connected....

Edited by DaveToland
Link to comment
Share on other sites

Try running:

start->program files->Auto Itv3->AutoIt Window Info

run the progrm and while connecting watch the window text section in the window info tool...it is possible that there is hidden window text displaying the status. If not you could try doing a pixel search for that green circle that appears next to connected once you are connected.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

  • Moderators

I tried this:

Do

$cmd = ControlCommand ("Ingenious", "", 5230, "FindString", "MAINWINDOW_STATUS_CONNECTED2")

Until $cmd <> 0

MsgBox(0, "Message", $cmd)

but it doesn't ever show the message, even when it is connected....

"MAINWINDOW_STATUS_CONNECTED2" is not the classname, it is the text reference to it. You need to expand the tree for "MAINWINDOW_STATUS_CONNECTED2" and use the classname with ControlCommand().
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...