Jump to content

Recommended Posts

Posted

I am tring to automate changing settings in a GUI application. However, when I put multiple send methods sequenced one after another some of them work and them it seems it just stops. I tried using one send call with multiple buttons in the arguments but it does the same thing. I also tried changing the delay time, still no luck. I am running the application on win7 if that makes a difference. I noticed there were topics pertaining to problems with vista/7. Please help me figure out how to get this working. I am new to AutoIt but not new to programming. Thanks

Posted

I originally had it this way.

Func changeSettings()
    Run("program.exe")
    WinWaitActive("Main Window")
    Send("!s")
    WinWaitActive("SETTINGS")
    Send("{DOWN}")
    Send("!u")
    Send("{DOWN 8}")
    Send("!e")
    Send("!o")
    WinClose("Main Window")

I also tried it like this

Func changeSettings()
    Run("program.exe")
    WinWaitActive("Main Window")
    Send("!s")
    WinWaitActive("SETTINGS")
    Send("{DOWN}!u{DOWN 8}!e!o")

Both of witch never complete the last !e and !o. Thanks

Posted

Try lengthening the SendKeyDownDelay. Maybe the program isn't recognizing the sent keys properly because they're too fast.

Put this at the start of your script:

Opt("SendKeyDownDelay", 50)
Posted

It's in milliseconds. By default, AutoIt holds down a key press for 5ms.

I got the 50ms when I tried making a turbo fire button for a vertical scrolling shooter I was playing a long time ago.

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
×
×
  • Create New...