Jump to content

Controlsend makes keys hang


Recommended Posts

For dual boxing guildwars i have the following function to make my second character follow my main character. it works good but the problem is that when it's sending the controlsend("Guild Wars Sec", "", "", "={space}") to my second guildwars window, it sometimes makes my wasd keys on my main guildwars window hang. with other scripts i've wrote with controlsend i've had the same problem. like if you alt tab out of your game to firefox sometimes your alt key hangs. increasing the sleep helps in the hang not occuring so often but it still does a bit.

this hanging would also probably occur if you just open 2 notepad windows and controlsend alot of text to 1 notepad window with a loop and try to type a few long sentences in the other notepad window

this is my function:

i've also tried to reduce the hanging with the timer function so it doesn't send the keys as often and it helps but in my main window the keys still hang sometimes

Func Followmain ()
    $begintimer = TimerInit()
    while 1 
        sleep(50)   
        if TimerDiff($begintimer) > 500 Then
            controlsend("Guild Wars Sec", "", "", "={space}")
            $begintimer = TimerInit()
        EndIf
        
        If _IsPressed("56", $dll) Then;v
            checkforpresses ()
        EndIf   
    
        If _IsPressed("43", $dll) Then;c
            dpslikemadstart ()
        EndIf
    WEnd
endfunc

i thought maybe it was something like when you press alot of keys on your keyboard at the same time it doesn't work, but that is probably not the case here since autoit is not using the keyboard but the winapi or something.

Does anyone have any solution for this problem? or anyone even ever had this problem?

Edited by Daggett
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...