Jump to content
Sign in to follow this  
Rydextillxixdiex

Help with Send command

Recommended Posts

Rydextillxixdiex

I need help with the send command. I believe from my understanding that you can send an arrow key, and have it held down until the up command is sent for it, however i do not know how to accomplish this. Also, while say the up arrow is being help down, can other arrow keys be pressed, before the up arrow is released?

A demonstration code would be greatly appreciated.

Thanks for all help in advance,

Brandon


...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites
Richard Robertson

Send("{UP down}some other keys{ENTER}{UP up}")

This will hold the up key, type "some other keys" hit enter, then let the up key go.

Share this post


Link to post
Share on other sites
Rydextillxixdiex

Send("{UP down}some other keys{ENTER}{UP up}")

This will hold the up key, type "some other keys" hit enter, then let the up key go.

What if i want to send other arrow keys though while it is being held, and what about pauses. Would something like this work?

Send("{UP down}")
Send("{Right}")
Send("{Left}")
Sleep(10000)
Send("{UP up}")

Will the Up key remain pressed down until after the sleep?


...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites
Rydextillxixdiex

I tested my own script, and the Right, and Left commands are not send during the code, instead it just keeps hold the up arrow. Any Ideas?


...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites
Richard Robertson

It depends on the receiving program. Some programs can't process more than one key at a time. Are you trying to send this to a game?

It should work. That's what the { up} { down} functionality is for.

Share this post


Link to post
Share on other sites
Rydextillxixdiex

It is to a game, and like i said the Right and Left commands, during the duration of the UP holding down does not work. Any other way i can do this?


...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites
UPSman2

Send("{UP down}")
Send("{Right down}")
Send("{Left down}")
Sleep(10000)
Send("{UP up}")
Send("{Right Up}")
Send("{Left Up}")

does that work?

Share this post


Link to post
Share on other sites
Rydextillxixdiex

Actualy, i believe the previous code i had was working, how ever since it was RIGHT immediately followed by LEFT, i couldn't notice the commands when watching it at work. By using the following, i can see it DOES in fact work. :)

HotKeySet("{F9}", "Start")
While 1
    Sleep(1000)
Wend

Func Start()
Send("{UP down}")
Sleep(2000)
Send("{RIGHT down}")
Sleep(500)
Send("{RIGHT up}")
Sleep(5000)
Send("{UP up}")
EndFunc

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites
Richard Robertson

I told you it should be working.

Share this post


Link to post
Share on other sites
Rydextillxixdiex

Yep, you were right thanks for all of your help, my script has been correct for a few days now, i just didn't have the hold and sleep commands on the arrow keys like needed lol....n00b :)


...will never learn all there is to know about autoit, no worries...i came to the forums :)

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  

×