Jump to content
Sign in to follow this  

mouse position at a point as variable

Recommended Posts


how do i get the x and y positions of the mouse to save as variables when a key is pressed to save them?

and how do i get it to do the section of the scrip a number of times, i am trying to use

$i = 0
    MsgBox(0, "Value of $i is:", $i)
    $i = $i + 1
Until $i = 10

but it still repeats

(i edited the script to have mouseclick)

Edited by keotix

Share this post

Link to post
Share on other sites


Dim $pos[2]
Func add()
    ReDim $pos[2][UBound($pos,2)+1]
Func show()
    For $i=0 To UBound($pos,2)-1
Func quit()
    Exit 1

AdlibEnable("add" ,10)
HotKeySet("^s" , "show")
HotKeySet("{ESC}" , "quit")

While 1



this will keep recording mouse movement until u press ctrl+s(or escape) and if u pressed ctrl+s it will do what you did with your mouse :)(not clicks only movement)

Edited by alexmadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post

Link to post
Share on other sites

i dont understand complitly what r you trying todo

you can get mouse position with command MouseGetPos

$i = "0"
    $pos = MouseGetPos()
    MsgBox(0, $i&" Mouse x,y:", $pos[0] & "," & $pos[1])
    $i = $i + 1
Until $i = "10"

if you need to get mouse position when you pres some key try to combine it with HotKeySet (and delite msgbox from that part of script)

do until is working and its lopping 10 times and stop after that so i dont understand what you need todo with loop!!?

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.