Jump to content

Recommended Posts

Posted (edited)

Made a tool that will get x/y coordinates for MouseClick... will automatically add

Opt("MouseCoordMode", 2)

WinTitle()

WinWaitActive()

Will add those again if win title changes

F1 grabs coordinates and F2 clears clipboard

Its all saved in clip board

Sample Output:

Opt("MouseCoordMode", 2)

WinActivate("AutoIt Forums -> Posting New Topic - Mozilla Firefox")

WinWaitActive("AutoIt Forums -> Posting New Topic - Mozilla Firefox")

MouseClick("left", 121, 103)

WinActivate("Awesom-O • User Control Panel • Compose message - Mozilla Firefox")

WinWaitActive("Awesom-O • User Control Panel • Compose message - Mozilla Firefox")

MouseClick("left", 132, 73)

WinActivate("Getting Started with Firefox - Mozilla Firefox")

WinWaitActive("Getting Started with Firefox - Mozilla Firefox")

MouseClick("left", 228, 74)

Source:

Opt("MouseCoordMode", 2)
 
$win2 = ""
ClipPut('Opt("MouseCoordMode", 2)')
HotKeySet("{F1}", "_GetPos")
HotKeySet("{F2}", "_ClearClip")

While 1
    Sleep(500)
WEnd

Func _GetPos()
    $anothertemp = @CRLF
    $mousepos = MouseGetPos()
    $win = WinGetTitle("")
    If $win <> $win2 Then $anothertemp &= 'WinActivate("' & $win & '")' & @CRLF & 'WinWait("' & $win & '")' & @CRLF
    $anothertemp &= 'MouseClick("left", ' & $mousepos[0] & ", " & $mousepos[1] & ")"
    ClipPut(ClipGet() & $anothertemp)
    $win2 = $win
EndFunc

Func _ClearClip()
    ClipPut('Opt("MouseCoordMode", 2)')
    $win2 = ""
EndFunc
Edited by tlokz

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...