mplews Posted September 24, 2008 Posted September 24, 2008 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.
ksmith247 Posted September 24, 2008 Posted September 24, 2008 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]
tgarr Posted September 24, 2008 Posted September 24, 2008 mplews said: 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.
mplews Posted September 29, 2008 Author Posted September 29, 2008 tgarr said: 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,
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 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. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
mplews Posted September 29, 2008 Author Posted September 29, 2008 dbzfanatic said: 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.
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 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? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
mplews Posted September 29, 2008 Author Posted September 29, 2008 dbzfanatic said: 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now