scatterjoy Posted September 4, 2008 Share Posted September 4, 2008 Hi, If this problem is common or otherwise identified as something else, please help me find the correct search term to implement a correction. We're using AutoIt to mimic keystrokes into a java based web application (oracle). We're using a Dell Latitude Core2Duo. Keystrokes sequences are programmed in AutoIT and the actual data entered is pulled from (directly or indirectly, I don't know) MSAccess. The issue is that data is often typographically incorrect (typos). For example, correct entry 801543 would read 01543 at a rate of 1 in 10 or so attempts. I added setkeydelay = 100 which reduced the error rate to about 1 in 50 attempts, but it's still inexplicable. It's as if AutoIT needs to take a typing course. Is there a common fix to this? The problem worsened on this new faster PC. I have been unable to find a way to slow the clockspeed reliably or at my technical level (nor do I wish that to be the solution). I really appreciate what this program can do. Super fun to learn this stuff. Link to comment Share on other sites More sharing options...
Pain Posted September 4, 2008 Share Posted September 4, 2008 Try to increase Opt("SendKeyDownDelay") some, from the helpfile: For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. Since you didn't post any code I don't know, but wouldn't it be possible to add for example 801543 to the clipboard with Clipput("801543") (or a variable in your case) and Clipget to send it? Link to comment Share on other sites More sharing options...
someone Posted September 4, 2008 Share Posted September 4, 2008 Is it possible for you to show your code, or a reproducer? Also, if you throw in a message box or console write is the text incorrect there or only after the send command (if you are using send that is). Otherwise, can you use controlsettext instead of send? or perhaps even clipput/clipget? Did you also playing with SendKeyDownDelay? If you can post a reproducer that would help a lot. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
scatterjoy Posted September 4, 2008 Author Share Posted September 4, 2008 Thanks. I've added the sendkeydowndelay, but in running another test, it appears that the setkeydelay and sendkeydowndelay may not be covering my tabs. It still blows turbo fast through tabs. Is there a way to fix this simplistic code to delay tabs? I believe the better solution would be to learn about loops. I can do a send tab sleep send tab sleep thing. ($Glprod = ERP screens running on Java GUI's (if I've used the terms correctly).) $A_KeyDelay = 100 $keydown = 100 ; Enter parameter on first screen and click 'Find' WinActivate ( $glprod_window_name ) WinWaitActive ( $glprod_window_name ) opt("sendkeydelay" , $A_KeyDelay) opt("sendkeydowndelay" , $keydown) Send ( $bpa_number & '{TAB 9}') sleep (1000) Send ( $bpa_line & '{TAB 3}') sleep (1000) Send ( $buyer_name & '{TAB 4}') Sleep (1000) Send ( $part_number & '!j' ) thanks again. Link to comment Share on other sites More sharing options...
scatterjoy Posted September 4, 2008 Author Share Posted September 4, 2008 Plus, we can investigate the clipget function. Link to comment Share on other sites More sharing options...
youknowwho4eva Posted September 4, 2008 Share Posted September 4, 2008 (edited) $A_KeyDelay = 100 $keydown = 100 ; Enter parameter on first screen and click 'Find' WinActivate ( $glprod_window_name ) WinWaitActive ( $glprod_window_name ) opt("sendkeydelay" , $A_KeyDelay) opt("sendkeydowndelay" , $keydown) for $n = 1 to 9 step + 1 Send ( $bpa_number & '{TAB}') sleep (1000) next for $n = 1 to 3 step + 1 Send ( $bpa_line & '{TAB}') sleep (1000) next for $n = 1 to 4 step + 1 Send ( $buyer_name & '{TAB}') Sleep (1000) next Send ( $part_number & '!j' ) Edit: well that should get you part the way there, you can figure it out from there. didn't think about it before i sent it Edited September 4, 2008 by youknowwho4eva Giggity 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