Jump to content

Recommended Posts

Posted

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

Posted

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)
  • Moderators
Posted

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

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

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...

Posted

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"

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

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...