Jump to content

How do I get a key to imput longer?


Recommended Posts

I'm trying to make a script that will make me move forward and back in a game, I have this so far:

HotKeySet( "{ESC}", "Close" )

$Key1 = InputBox( "Input key", "Enter a key that will be repeated." )
$Key2 = InputBox( "Input key", "Enter a key that will be repeated." )


while 1
    Sleep( 1000 )
    Send( $Key1 )
    Send( $Key2 )
WEnd


Func Close()
    Exit()
EndFunc

But when I run it, it sends the imputs too fast for the game to register. How would I fix that?

Link to comment
Share on other sites

So like this?

HotKeySet( "{ESC}", "Close" )

$Key1 = InputBox( "Input key", "Enter a key that will be repeated." )
$Key2 = InputBox( "Input key", "Enter a key that will be repeated." )


while 1
    Sleep( 1000 )
    Send( $Key1 )
    Send( $Key2 )
    Opt('SendKeyDownDelay', 250)
WEnd


Func Close()
    Exit()
EndFunc
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...