Jump to content

Mouse not clicking on coordinates


Recommended Posts

Ok, yeah so you've heard it before.. another newb trying autoit.

I've been paying attention and the help file has become my friend. I've also been searching alot on the forums and have learned a bunch.

I'm making a bot for a game I play which will remain unmentioned. I have a gui working where it grabs the mouse coordinates and displays them in a msgbox for me for testing. I then set a button to click the same coordinates when pressed and then a message box pops up to confirm the coordinates again for me. Like I said, just learning and trying to learn by testing. The problem is when I click the button that mimics clicking my coordinates the mouse just goes to the top of the screen. I've set the mousecoordmode to 1 so that it is relative to the screen. The mouseclick function I'm using is below.

Not asking for the code, but can someone point me in the right direction. Is there a mode setting I'm missing? Not sure where to look next.

func testit()
    mouseclick("left", $xcapture & "," & $ycapture,1)
    msgbox(0,"coordinates:", $xcapture & "," & $ycapture)
EndFunc
Link to comment
Share on other sites

Despite cueclub's very reasonable point about game-bots, your func is just wrong, try this:

Func testit()
    mouseclick("left", $xcapture, $ycapture, 1)
    msgbox(0,"coordinates:", $xcapture & "," & $ycapture)
EndFunc

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

Despite cueclub's very reasonable point about game-bots, your func is just wrong, try this:

Func testit()
    mouseclick("left", $xcapture, $ycapture, 1)
    msgbox(0,"coordinates:", $xcapture & "," & $ycapture)
EndFunc

Thanks for the warning. I figured naming a specific game could be a problem so I did not. Thanks for correcting my function! Like I said, just starting and was trying to tinker.
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...