Sign in to follow this  
Followers 0

Mouseclick in specific cords, and window.

18 posts in this topic

Posted

i was searching on the internet, and i kinda fell over this site.

Im new at this autoit thing, and i have searched alot, trying to find something, usefull, without luck.

I want to make a script, that moves the mouse to a specific location, then do one mouse click, and then move the mouse to another location, and then do a click, and so on.

i have the cords for where the mouse should click, i have figered that out.

but i don't know if

MouseClick

could do it, or do i have to make a

Mousemove

First, and then do a mouse click?

I have tryed to fit the cords and all that in to Mouseclick, but it seems that i ain't putting it the right place, because its getting red every time i try.

And i don't know how to get the window name, is it just the name in top of the window i have to get?

If someone could post, an exampel, of where to put the window name, and cords, and maybe tell me witch commands i sould use, "mouseclick" or "mousemove then click"

It would be vary helpfull

Thanks alot,

Share this post


Link to post
Share on other sites



Posted

No need to use MouseMove between 2 MouseClick.

For window title, you need to use AutoIt Window Info Tool.

Share this post


Link to post
Share on other sites

Posted

okay, so i just have to use Mouseclick, and with that, i can get the mouse moving to specific location?

Could you try post and exampel ? :mellow:

Share this post


Link to post
Share on other sites

Posted (edited)

The window name or window title is the text located in the top of the window. you can get this title (that sometimes is hidden) using the AutoIt Window Info Tool that comes with AutoIt.

About the function, bout ways are fine, if you use MouseMove you probably end up using MouseClick without coordenates in his parameters. Read the HelpFile in detail when you want to learn to implement some function, also the HelpFile has examples at the end where you can see how is implemented that function.

If you want to have an easy way to open the help file in a specific function, you should...

...Click once in the text of the function

...Press F1 Key

This works when you use the SciTe Editor(I strongly recommend to download the full version of this editor and use it)

And at the end i left to you an example of MouseClick() and MouseMove() function

ToolTip("Moving mouse to the 0, 0 coordenates",500,0)
mousemove(0,0,50) ; I set the speed parameter to "50")
ToolTip("Clicking once Right Click at the Coordenates 500, 500",500,0)
mouseclick("right",500,500,1,50)
ToolTip("Clicking three left Click at the Coordenates 0," &@desktopheight,500,0)
mouseclick("left",0,@desktopheight,3,50) ; look for @desktopheight in the help file, is a MACRO
ToolTip("Clicking Left Click at the Middle of the screen",500,0)
mouseclick("Left",@desktopwidth/2,@desktopheight/2,1,50)
ToolTip("Moving the mouse at different speeds",500,0)
For $i = 0 to 5 ; A loop
mousemove(Random(0,@desktopwidth,1),Random(0,@desktopheight,1),Random(0,100,1))
next
ToolTip("")

And welcome!

Edited by monoscout999

Share this post


Link to post
Share on other sites

Posted

How do i get it to loop, so when its done, it just do it again, and again, and again, ?

And where do i put in the window name, so that when i have a window open, it will click in the window? :mellow:

And thanks, for the exampel, i have found out how to make it work now, now i just need the loop, and how to get it to click in a window :)

Share this post


Link to post
Share on other sites

Posted

You can use While / WEnd for a loop

but show what you already have done.

Share this post


Link to post
Share on other sites

Posted (edited)

Vague topic with no example code is vague. Perhaps OP is trying to avoid saying *WHAT* he wants it for simply because it may be against forum rules?

Suggestion... use notepad to learn with.

Edited by Blue_Drache

Share this post


Link to post
Share on other sites

Posted

Vague topic with no example code is vague. Perhaps OP is trying to avoid saying *WHAT* he wants it for simply because it may be against forum rules?

Suggestion... use notepad to learn with.

agreed

Share this post


Link to post
Share on other sites

Posted

anyway the user is noob in scriptting, but i agree that he has to show us the code that he is working with.

sorry if my english is not good.

Share this post


Link to post
Share on other sites

Posted (edited)

Regarding the OP's original question about moving the mouse and/or clicking the mouse...

MouseMove()
MouseClick()

A simple click on the functions will bring up the online help.

Or ... if you prefer ... Middle click so you can keep this page open.

Read. Learn. Enjoy.

Edited by Blue_Drache

Share this post


Link to post
Share on other sites

Posted

Okay okay, im not trying to do anything aginst forum rules,

I am just trying to make the mouse move, and click specific locations, im not trying to make anything big, just trying to learn.

I have to start some place?

And get the mouse moving, is a good start, getting it to click at a specific pos, is allso good to learn, then i wanna learn, how to get it click in a specific window.

What i have larned so far is this.

mouseclick("left",400,400,1,50); "Mouseclick" is the command - "left" is witch button on the mouse it should use - "400,400" is the cords - "1" is how many clicks - "50" is the speed

don't think that learning is aginst forum rules?

What i asking about is, that when i get it to move from pos 400,400 to 546,347 (exampel) i need it to start over then go back to 400,400 and then 546,347 again, a loop.

what i don't understand is that, when i get the cords in a window, and put it in the script, the mouse is not moving to the pos where i got the cords in the first place?

And if i understand it right, its because i need to put in the name of the window, but where do i put it in? can you give an exampel? :mellow:

Sorry for bad english! :)

Share this post


Link to post
Share on other sites

Posted

Vague topic with no example code is vague. Perhaps OP is trying to avoid saying *WHAT* he wants it for simply because it may be against forum rules?

Suggestion... use notepad to learn with.

AS I am to understand how the rules are interpreted, if the poster doesn't say it's for a game, and it's not obvious from the code posted or from what the user has posted that it's for a game, it's legitimate to ask any questions. Until such time that it's obvious that it's for a game, that's when the helping should stop.

Anything else is badgering a poster because you are trying to get them to confess something before you have evidence that they're doing anything against the rules. I look at it this way, assume that the poster is innocent until you can prove otherwise.

Share this post


Link to post
Share on other sites

Posted

Thank you BrewManNH.

Im not making any script for any game :mellow:

Just trying to learn (:

Hope someone could help me with my last post :)

Share this post


Link to post
Share on other sites

Posted

Thank you BrewManNH.

Im not making any script for any game :mellow:

Just trying to learn (:

Hope someone could help me with my last post :)

while 1
mouseclick("left",400,400,1,50)
mouseclick("left",546,347,1,50)
WEnd

Share this post


Link to post
Share on other sites

Posted

thanks alot :mellow:

Share this post


Link to post
Share on other sites

Posted

i got another question, can i make, so that when the mouse click, it hold it down?

Lets say mouseclick at 400,359 and then hold it down until 400,538? (eksempel)

Share this post


Link to post
Share on other sites

Posted

i got another question, can i make, so that when the mouse click, it hold it down?

Lets say mouseclick at 400,359 and then hold it down until 400,538? (eksempel)

MouseClickDrag ?

Share this post


Link to post
Share on other sites

Posted

You also want to make sure the specific window is active.

WinActivate()
WinWaitActive()

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