Sign in to follow this  
Followers 0
J-F

Keys written are not the good one

9 posts in this topic

Hi

I had a little problem and I was wondering if it happend to you in the past.

From time to time, when I run a script, AutoIt doesn't type the proper keys.

For Exemple if I say to Autoit to execute the following command : Run ("C:\Program files\"), Au3 will type C:|Program files| .

It happens like less than 5% of the time I decide to run a script. I didn't change my keyboard language or my computer language. My keyboard language is in French(Canada) while my pc is in English. On my keyboard to type \ you have to press Ctrl-Alt and the key situated at the left of the number 1. While the | is shift and the same button.

I found a solution to correct the problem, when it happens I run the this script :

run("notepad.exe")
sleep(1000)
WinActivate("Untitled - Notepad")
Send("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\")
Send("|||||||||||||||||||||||||||||||||||||||||")

Then I re-run the script I wanted.

So I was wondering did you had a similar problem and do you have a better way to prevent this from happening again?

Many thanks

J-F

Share this post


Link to post
Share on other sites



I have been trying to find the post.. but I believe someone before said that in a low percentage of their Send()'s it would send the wrong key. I still havent found it though.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

If the object your sending it to has a ControlID you may look at ControlSetText() rather than Send().

@Simucal - it was vollyman and someone else I believe :D


[center]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.[/center]

Share this post


Link to post
Share on other sites

If the object your sending it to has a ControlID you may look at ControlSetText() rather than Send().

@Simucal - it was vollyman and someone else I believe :D

i'd put money on it that they're either pressing shift, or they have a shift down somewhere in their script. in situations where i have to use ControlSend or Send instead of ControlSetText, alot of times i'll have it use ascii values instead of typing the characters...example:

$string = "This is the string i want sent"
for $x = 1 to stringlen($string)
    Send(chr(asc(StringMid($string,$x,1))))
Next

it doesn't slow down execution too much, but makes it so that shift or capslock state won't affect keys being transmitted...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

i have a problem with keys also if you type them to fast it can't keep up with you, :D


[s]Autoit[/s]

Share this post


Link to post
Share on other sites

Just a wild thought..

Try sending the keys 'raw' by changing the flag to 1

(Send ( "keys" [, flag] ) )

example

Send("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\",1)

Share this post


Link to post
Share on other sites

Really usefull informations.

Many thanks to all of you.

Cameronsdad and SmOke_N, your tips are really usefull and it may help my scripts to be "bugs free"

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Really usefull informations.

Many thanks to all of you.

Cameronsdad and SmOke_N, your tips are really usefull and it may help my scripts to be "bugs free"

no problem, always gald to help. and debugging is half of the fun....

***edit*** typo

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0