Jump to content

Old DOS GUI - Can I avoid fixed time delays


kheston
 Share

Recommended Posts

I'm using AutoIT with an old DOS GUI. It works fine with Sleep(<somevalue>) between actions but I'm having to be pretty conservative with the amount of time I wait (longer is better).

I'd like to make things faster by polling the window to see if the screen is displaying desired text and use it to decide what keystroke to send next (and when) but can't make any of the methods I've read about work. Both StdoutRead and WinGetText return empty strings.

Suggestions?

Link to comment
Share on other sites

  • Moderators

I'm using AutoIT with an old DOS GUI. It works fine with Sleep(<somevalue>) between actions but I'm having to be pretty conservative with the amount of time I wait (longer is better).

I'd like to make things faster by polling the window to see if the screen is displaying desired text and use it to decide what keystroke to send next (and when) but can't make any of the methods I've read about work. Both StdoutRead and WinGetText return empty strings.

Suggestions?

Maybe use AdlibEnable() to do the polling function?

AdlibEnable('_OldDosCheck', 100);Poll function to do what you are normally doing every 100 ms

While 1
    Sleep(0x7FFFFFFF)
WEnd

Func _OldDosCheck()
    ;Whatever you are doing in your other script now
EndFunc

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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