Sign in to follow this  
Followers 0
Arez

Send Alt Indefinitely While Doing A Task

8 posts in this topic

This is the code I need help with:

While 1

Send("{ALT}")

WEnd

MouseClick("left", 631, 0, 2, 2.5)

It gets stuck on alt and doesn't go to the next thing. Is there any way for it to keep alt held down while the mouse moves?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HotKeySet("{esc}", "_Close")
While 1
Send("{ALT}" & MouseClick("left", 631, 0, 2, 2.5))
WEnd

Func _Close()
Exit
EndFunc

You had the MouseClick() outside the While loop... so it would be impossible to get to it with just that code...

If i were you, i would put that hotkey in their, so u can get out of the program without having to restart your computer.

Edited by CHRIS95219

Share this post


Link to post
Share on other sites

HotKeySet("{esc}", "_Close")
While 1
Send("{ALT}" & MouseClick("left", 631, 0, 2, 2.5))
WEnd

Func _Close()
Exit
EndFunc

You had the MouseClick() outside the While loop... so it would be impossible to get to it with just that code...

If i were you, i would put that hotkey in their, so u can get out of the program without having to restart your computer.

Since when do you need to restart your computer to close an AutoIt script?

Also - you might want to do Send ("{ALTDOWN}") before the mouseclick and Send ("{ALTUP}") after (does the same as alt+click.

Share this post


Link to post
Share on other sites

Since when do you need to restart your computer to close an AutoIt script?

Also - you might want to do Send ("{ALTDOWN}") before the mouseclick and Send ("{ALTUP}") after (does the same as alt+click.

since the mouse moves to a position at the top of my screen and keeps clicking so all windows will loose FOCUS...

???

Share this post


Link to post
Share on other sites

I have about fifty different mouse coordinates, Send("") functions and so on in the code I have. Alt needs to be pressed for all. Is there any way to make it more general instead of just for that specific thing?

Share this post


Link to post
Share on other sites

ALTDOWN.....

Share this post


Link to post
Share on other sites

I have about fifty different mouse coordinates, Send("") functions and so on in the code I have. Alt needs to be pressed for all. Is there any way to make it more general instead of just for that specific thing?

Just do Send("{ALTDOWN}") before all the mouse clicks... then after all the mouse clicks are done, do Send("{ALTUP}")

ex..

While 1
Send("{ALTDOWN")
;Mouse Clicks go here
;Mouse Clicks go here
;Mouse Clicks go here
;Mouse Clicks go here
Send("{ALTUP}")
WEnd

Share this post


Link to post
Share on other sites

Thanks for the help guys, works fine

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  
Followers 0