dbc13543 Posted December 27, 2018 Posted December 27, 2018 I'm trying to write my first AutoIt script and it's going disastrously wrong, was wondering if anyone can help. It's not much more complicated than a "Hello World" piece of code, but I've been at it for hours and am incredibly frustrated. The purpose of the program is to send a complex password when I press a key combo. The password consists of upper- and lowercase letters, numbers, and punctuation. This is the code I'm using: HotKeySet( "^!p", "SendPass" ) ; Ctl-Alt-p ; Just go to sleep forever While 1 Sleep(1000) WEnd Func SendPass() Send( "PassWord(%^#", 1 ) EndFunc ; SendPass() The problem I have is that the Ctl-Alt key combination I use to invoke the HotKey "sticks". i.e. - When the function ends and control returns to the user, the "Ctl" and "Alt" keys are stuck in the pressed condition. Every key I press from that point forward is interpreted by Windows as a Ctl-Alt key combo. The only way I can "unstick" the keys is by manually pressing Ctl and Alt again. I've tried changing the password string to escape all special characters ( i.e. - "+pass+word(%{^}{#}" ) and invoking Send so it *doesn't* send raw keystrokes, but the effect is identical. If my password is pure lowercase text everything works, but who has a password with no uppercase characters or punctuation? Thanks in advance for any ideas!
FrancescoDiMuro Posted December 27, 2018 Posted December 27, 2018 (edited) Hi @dbc13543, and welcome to the AutoIt forums Depending on which application are you trying to send the password to, you can use Control* functions to make it more "dynamic". By the way, about your question, take a look here Edited December 27, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Nine Posted December 27, 2018 Posted December 27, 2018 This guy had similar problem and he solves it with this : “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
dbc13543 Posted December 27, 2018 Author Posted December 27, 2018 Thank-you, using ControlSend solved the issue. It seems like something is broken out of the box, because even the sample code in the documentation for HotKeySet will fail if you send more than 3 or 4 characters at once. But thank-you to the helpful people who set me on the right path.
FrancescoDiMuro Posted December 27, 2018 Posted December 27, 2018 @dbc13543 Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
ViciousXUSMC Posted December 27, 2018 Posted December 27, 2018 I have suffered this issue before with the modifier keys. Usually just decided to use an F Key or something to work around it. Your sleep of 1000ms is higher than you need something like 10ms will save you the cpu cycles but make your hotkey more responsive. Regards,
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