Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Mouseclick in specific cords, and window.


  • Please log in to reply
17 replies to this topic

#1 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 07:11 AM

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,







#2 wakillon

wakillon

    Tiny Tools Coder

  • Active Members
  • PipPipPipPipPipPip
  • 2,839 posts

Posted 11 August 2011 - 07:15 AM

No need to use MouseMove between 2 MouseClick.

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

       AutoIt Version : 3.3.12.0 / Beta 3.3.13.8 SciTE 3.4.1 OS:WIN7/WIN8.1 CPU:X64 OS:X64


#3 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 07:20 AM

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:

#4 monoscout999

monoscout999

    a member

  • Active Members
  • PipPipPipPipPipPip
  • 1,064 posts

Posted 11 August 2011 - 07:31 AM

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, 11 August 2011 - 07:32 AM.


#5 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 01:33 PM

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

#6 wakillon

wakillon

    Tiny Tools Coder

  • Active Members
  • PipPipPipPipPipPip
  • 2,839 posts

Posted 11 August 2011 - 01:42 PM

You can use While / WEnd for a loop

but show what you already have done.

       AutoIt Version : 3.3.12.0 / Beta 3.3.13.8 SciTE 3.4.1 OS:WIN7/WIN8.1 CPU:X64 OS:X64


#7 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,488 posts

Posted 11 August 2011 - 01:46 PM

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, 11 August 2011 - 01:47 PM.

Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#8 MBALZESHARI

MBALZESHARI

    Member of the Hide & Seek world league

  • MVPs
  • 11,303 posts

Posted 11 August 2011 - 02:37 PM

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

The Vollatran project
_____

 

 

The Basic Con

 

Those who can't find anything to live for, always invent something to die for.

Then they want the rest of us to die for it, too.

These, and an elite army of thousands, who do nobody any good at all, but do great harm to some, have always collected vast sums from all.

Finally, all this machinery tries to kill us, because we won't die for it, too.


#9 monoscout999

monoscout999

    a member

  • Active Members
  • PipPipPipPipPipPip
  • 1,064 posts

Posted 11 August 2011 - 02:46 PM

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.

#10 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,488 posts

Posted 11 August 2011 - 03:18 PM

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



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, 11 August 2011 - 03:19 PM.

Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image

#11 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 04:38 PM

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

#12 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 10,016 posts

Posted 11 August 2011 - 04:44 PM

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 an XP machine, 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!

 

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.
GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips. Latin Square password generator

 

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.


#13 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 05:41 PM

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

#14 PowerCat

PowerCat

    Adventurer

  • Active Members
  • PipPip
  • 119 posts

Posted 11 August 2011 - 05:54 PM

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


#15 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 06:18 PM

thanks alot :mellow:

#16 spootnick

spootnick

    Seeker

  • Active Members
  • 14 posts

Posted 11 August 2011 - 06:20 PM

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)

#17 wakillon

wakillon

    Tiny Tools Coder

  • Active Members
  • PipPipPipPipPipPip
  • 2,839 posts

Posted 11 August 2011 - 06:27 PM

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 ?

       AutoIt Version : 3.3.12.0 / Beta 3.3.13.8 SciTE 3.4.1 OS:WIN7/WIN8.1 CPU:X64 OS:X64


#18 Blue_Drache

Blue_Drache

    Revolutionary Flavour

  • Active Members
  • PipPipPipPipPipPip
  • 3,488 posts

Posted 11 August 2011 - 08:19 PM

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


Lofting the cyberwinds on teknoleather wings, I am...The Blue DrachePosted ImagePosted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users