Sign in to follow this  
Followers 0
keotix

mouse position at a point as variable

4 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

Here:

Dim $pos[2]
Func add()
    ReDim $pos[2][UBound($pos,2)+1]
    $t_pos=MouseGetPos()
    $pos[0][UBound($pos,2)-1]=$t_pos[0]
    $pos[1][UBound($pos,2)-1]=$t_pos[1]
    ToolTip(UBound($pos,2),0,0)
EndFunc
Func show()
    AdlibDisable()
    For $i=0 To UBound($pos,2)-1
        MouseMove($pos[0][$i],$pos[1][$i],0)
        Sleep(1)
    Next
EndFunc
Func quit()
    Exit 1
EndFunc

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

While 1
    Sleep(10)
WEnd

Cheers.

Edit:explanation

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"
Do
    $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)



460px-Thief-4-temp-banner.jpg
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

thanks guys

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