Jump to content

Send Alt Indefinitely While Doing A Task


Arez
 Share

Recommended Posts

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?

Link to comment
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.

Edited by CHRIS95219
Link to comment
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.

Link to comment
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...

???

Link to comment
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?

Link to comment
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
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...