Nucks Posted September 8, 2006 Share Posted September 8, 2006 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 8, 2006 Moderators Share Posted September 8, 2006 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. Link to comment Share on other sites More sharing options...
Nucks Posted September 8, 2006 Author Share Posted September 8, 2006 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 Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 (edited) Now, are you trying to use the number 9 on the *number pad*? If so you must use {NUMPAD9} and not 9. Edited September 8, 2006 by EWOlson Link to comment Share on other sites More sharing options...
Nucks Posted September 8, 2006 Author Share Posted September 8, 2006 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. Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 And the code that you have above is exactly what you are using? Link to comment Share on other sites More sharing options...
Nucks Posted September 8, 2006 Author Share Posted September 8, 2006 Yes it is. I copied and pasted it right out of the file for a3. Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 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) Link to comment Share on other sites More sharing options...
Nucks Posted September 8, 2006 Author Share Posted September 8, 2006 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 Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 You are quite welcome. Glad to be of help. Link to comment Share on other sites More sharing options...
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