Jump to content

Getting AutoIt to sync to slow program


mplews
 Share

Recommended Posts

I'm getting AutoIt to run a series of send commands into a pretty slow going program that runs at a bit of a variable pace depending on network speed. The program I've made usually runs fine, and I've got round the problem most of the time by working in a lot of short sleep commands. While having slowed my program a bit this seems to help it get over running into a slowpaced window.

However, every now and again when the network is running particularly slowly my program will still get out of sync and end up having a bit of a spasm as it starts to put lines of text in out of sync.

Is there a command or area I should look at in order to get my script to be able to read what speed the slowrunning program is going at so that it doesn't end up hiccupping?

Many thanks.

Link to comment
Share on other sites

If you are sending text then sending {ENTER} or ControlClick() (to move to a different window) you can look at WinWait() or WinWaitActive() to pause the script until the window you want is open. If this isn't helpful can you be a bit more descriptive about the program you are trying to automate?

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Link to comment
Share on other sites

I'm getting AutoIt to run a series of send commands into a pretty slow going program that runs at a bit of a variable pace depending on network speed. The program I've made usually runs fine, and I've got round the problem most of the time by working in a lot of short sleep commands. While having slowed my program a bit this seems to help it get over running into a slowpaced window.

However, every now and again when the network is running particularly slowly my program will still get out of sync and end up having a bit of a spasm as it starts to put lines of text in out of sync.

Is there a command or area I should look at in order to get my script to be able to read what speed the slowrunning program is going at so that it doesn't end up hiccupping?

Many thanks.

use the control winWaitActive command to tell the script to wait until a particular window becomes active. you can take out all of those sleeps when you incorperate that to speed up the script a little.

Link to comment
Share on other sites

use the control winWaitActive command to tell the script to wait until a particular window becomes active. you can take out all of those sleeps when you incorperate that to speed up the script a little.

Many thanks for the comments above, very helpful.

Tgarr,

As the program can slow down at any point, would I need to have every other line of code as a winwaitactive command? For example would I have to use a send command, then use a winwaitactive command, then another send command and so on?

Cheers,

Link to comment
Share on other sites

As long as the commands are being sent to the same window you should only need WinWaitActive() once. But for every window change you should put another in.

Link to comment
Share on other sites

As long as the commands are being sent to the same window you should only need WinWaitActive() once. But for every window change you should put another in.

I am currently using the winwaitactive command in the script i'm running. This does seem to make AutoIt wait until the window is active before inputting the first line of text, but it is usually after several lines of send commands when the program gets knocked out of sync.

Is there any benfeit to including more winwaitactive commands you reckon?

Ta.

Link to comment
Share on other sites

Adding more WinWaitActive() commands won't really help if the window is already active and things are thrown out of sync. Are you trying to do an installation over the network? What exactly is the program you're trying to automate? Basic question is does it have multiple pages, if so is that where the program is losing its synchronization?

Link to comment
Share on other sites

Adding more WinWaitActive() commands won't really help if the window is already active and things are thrown out of sync. Are you trying to do an installation over the network? What exactly is the program you're trying to automate? Basic question is does it have multiple pages, if so is that where the program is losing its synchronization?

I'm trying to automate into a vamp session, on PC Comms- an extremely old looking program which we've never been able to replace. I'm basically running macros into one window of this.

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