Indrion Posted March 15, 2009 Share Posted March 15, 2009 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 More sharing options...
Authenticity Posted March 15, 2009 Share Posted March 15, 2009 Opt('SendKeyDownDelay', 250) ? Link to comment Share on other sites More sharing options...
Indrion Posted March 15, 2009 Author Share Posted March 15, 2009 Where would that go? I have almost no experience writing code. Link to comment Share on other sites More sharing options...
James Posted March 15, 2009 Share Posted March 15, 2009 (edited) Below the includes - that's the common place. You have none, at the top. Edited March 15, 2009 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Indrion Posted March 15, 2009 Author Share Posted March 15, 2009 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 More sharing options...
Authenticity Posted March 15, 2009 Share Posted March 15, 2009 Almost, like this: Opt('SendKeyDownDelay', 250) 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 Link to comment Share on other sites More sharing options...
Indrion Posted March 15, 2009 Author Share Posted March 15, 2009 Ah, thanks. I'll catch on eventually. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now