Jump to content

Mouseclick to Coord Addition


le_G
 Share

Recommended Posts

Hi,

I can't make what I what. I would like to Mouseclick to a MouseCoord + 27px in X and + 62px in Y for exemple.

 

$MousePos = MouseGetPos()
$MousePos[0] ; Mouse X position
$MousePos[1] ; Mouse Y position
    Func _CMDR()
    MouseClick ("left")
    Sleep (500)
    MouseClick ("right", $MousePos[0], $MousePos[1], 1)
EndFunc

1.au3

Link to comment
Share on other sites

Welcome to the forum.  The problem is that your first two array elements are not actually referenced in the context of doing anything.  You don't need to reference those elements until you use them try this to see what I mean (and you need to call the function):

$MousePos = MouseGetPos()
;$MousePos[0] ; Mouse X position ; not needed
;$MousePos[1] ; Mouse Y position ; not needed
Func _CMDR()
    MouseClick ("left")
    Sleep (500)
    MouseClick ("right", $MousePos[0]+27, $MousePos[1]+62, 1)
EndFunc

_CMDR()

 

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

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