Jump to content

Mouseclick in specific cords, and window.


Recommended Posts

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,

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

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

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

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! :)

Link to comment
Share on other sites

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.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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...