Jump to content

On Mouseclick


 Share

Recommended Posts

It's been quite a while that i have used AutoIt.

I'm just wondering if i can create this.

A programm that draws after my cordinates.

So my idea is that i create 2 Arrays. (with 50 for now) and every time i make a Mouseclick, while the function is running, i assign a new set of X,Y Arrays to that click. So click 1 X[0]Y[0] click 2 X[1]Y[1] etc.

But i have not found any "on mouseclick" feature.

Help :)

Link to comment
Share on other sites

There is function which you can use to mouse click: MouseClick ( "button" [, x, y [, clicks [, speed]]] ) but you will have to create the array of 50 then execute the function in a for loop of 50.

Link to comment
Share on other sites

Yeah i know MouseClick :) I have no problem once i got the Arrays Defined. But i want to define a array on Mouseclick to be X,Y of the Mouseclicks location.

That is not possible by the that function, the only way to go with this would be to execute in a loop. ;)

Link to comment
Share on other sites

Yeah but how can i track the mouses location? i gotta give the script some input to set the arrays to mouse.X and mouse.Y

Ok, we will have to use a event "$GUI_EVENT_PRIMARYDOWN" so we know when you click and then MouseGetPos ( [dimension] ) function to get the co-ordinates, then set them to the array.
Link to comment
Share on other sites

#include <misc.au3>
if _ispressed("01") then; this says is left mouse down 0/1
   beep()
   $mxy= MouseGetPos();$mxy[0] is mouse x, $mxy[1] is mouse y
endif

Edited by Xandy
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...