Jump to content

Recommended Posts

Posted

Hello,

I want to thank everyone for their help, even though you didn't realize you were helping me. I have searched the forums and read the help file. I almost have this script down but one thing isn't working right.

HotKeySet("{F12}", "Stop")

HotKeySet("{F11}", "Start")

While 1

Sleep(100)

WEnd

Func Stop()

Exit 0

EndFunc ;==>Stop

Func Start()

While 1

Send('2')

Sleep(500)

Send('5')

Sleep(500)

Send('4')

Sleep(500)

Send('6')

Sleep(3000)

Send('8')

Sleep(3000)

Send('!9')

Sleep(3000)

Send('!7')

Sleep(3000)

Send('6')

Sleep(3000)

Send('9')

Sleep(3000)

Send('2')

Sleep(500)

Send('4')

Sleep(500)

Send('5')

Sleep(500)

Send('!9')

Sleep(3000)

Send('!8')

Sleep(3000)

Send('6')

Sleep(3000)

Send('0')

Sleep(3000)

Send('!9')

Sleep(3000)

Send('-')

WEnd

EndFunc ;==>Start

Any time I use the Send('!9) [anything with !] it does not use it as ALT. The program is acting as if the ! is not there. I experimented and put a + in and it did the shift correctly.

Any thoughts would be appreciated and I will continue to lurk to learn more.

Thank you.

  • Moderators
Posted

Seems to work fine for me:

HotKeySet('!9', '_Test')

Sleep(3000)
Send('!9')

Func _Test()
    MsgBox(64, 'Info', 'Alt + 9 was pressed.')
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.

Posted

I have been working with it some more and I noticed something interesting. Every once in a while it would work for hitting the ! (ALT) but it would never hit the ! everytime it was suppose to.

I even tried doing this script but it wouldn't work on a consist basis.

Send ('{ALTDOWN}')

Send ('9')

Send ('{ALTUP}')

Sleep (3000)

But when I manually work in the program ALT+9 works 100% of the time. I will keep looking around and maybe another suggestion will come.

thank you

Posted (edited)

Now, are you trying to use the number 9 on the *number pad*? If so you must use {NUMPAD9} and not 9.

Edited by EWOlson
Posted

I see the error in my title. I am trying to use the "9" the is above the letter I on the keyboard. But this still works once in a while which I can't figure out.

Posted

OK, I knew I had seen something that had to do with button presses and games. (I'm assuming this is a game question.) The value is SendKeyDownDelay. It defaults to 5 milliseconds, and it sounds like you need to increase that.

AutoItSetOption("SendKeyDownDelay", 10)

Posted

Thank you EWOlson. That was it exactly. I had to up the milliseconds to 30 and it worked perfectly. Never even thought of that one.

Case Closed

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...