Jump to content
Sign in to follow this  
Indrion

How do I get a key to imput longer?

Recommended Posts

Indrion

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?

Share this post


Link to post
Share on other sites
Authenticity

Opt('SendKeyDownDelay', 250) ?

Share this post


Link to post
Share on other sites
Indrion

Where would that go?

I have almost no experience writing code.

Share this post


Link to post
Share on other sites
Indrion

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.