Jump to content

ControlSend bug?


heman
 Share

Recommended Posts

$i=0
while $i=0
    ControlSend("MyGame","","","1") 
    Sleep(Random(800,2555)) 
    if Random(1,15,1)=1 then ControlSend("MyGame","","","2")    
WEnd

thats my code, it simply send 1 or 2 with randoms between 800 and 2555 ms delay. This is working perfect BUT:

on other windows i do work and obviously autoit forgets some keys pressed. Every 5-10 seconds it happens that my CTRL or CAPTCHA or SHIFT or combination is kept pressed! So while i develop on other windows then "MyGame" i sometimes type things in big chars, i sometimes DELETE whole line because CTRL and SHIFT is pressed at same time and i click "m" and whole line goes. Something is doing wrong. Can someone help me please?

I am using vista 64bit business edition on dual xeon and dual desktop.

regards

Link to comment
Share on other sites

Why do you think the problem is in the sending part, and not on the receiving part? : )

You're probably using this for a game, but AutoIt is often too fast and clever for the game. So the game gets confused and it thinks that the shift or control key is still pressed down, but it's not!

Try sending a your keys to the game slower, and give it more time to process your keys. Check out the AutoIt options SendKeyDelay and SendKeyDownDelay. You can also try sending shift or ctrl up commands, check out the send key list for {SHIFTUP}.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...