Jump to content

Recommended Posts

Posted

I am having problems with getting the mouse to click the right coords that I jotted down. I am working on a "bot" for a game. I tried increasing the delays, but it still clicks the wrong places. This is my code.

;----D2Portal Runner----
Func D2PortalRunner()
Sleep(10000)
MouseMove(110, 411)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(193, 394)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(194, 353)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(179, 447)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(218, 399)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(173, 417)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(143, 424)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseMove(93, 99)
Sleep(2500)
MouseClick("left")
Sleep(5000)
MouseClick("left", 321, 203)
EndFunc
  • Moderators
Posted

First, waiting after your MouseMove for a period of time, could change the coords of your mouse position if your mouse get's bumped or something. Looks like you would be safer just doing MouseClicks:

Also... Try Adding Opt("MouseCoordMode", 0)

Opt("MouseCoordMode", 0)

;----D2Portal Runner----
Func D2PortalRunner()
Sleep(10000)
MouseClick("left", 110, 411, 1,  1)
Sleep(5000)
MouseClick("left", 193, 394, 1, 1)
Sleep(5000)
MouseClick("left", 194, 353, 1, 1)
Sleep(5000)
MouseClick("left", 179, 447, 1, 1)
Sleep(5000)
MouseClick("left", 218, 399, 1, 1)
Sleep(5000)
MouseClick("left", 173, 417, 1, 1)
Sleep(5000)
MouseClick("left", 143, 424, 1, 1)
Sleep(5000)
MouseClick("left", 93, 99, 1, 1)
Sleep(5000)
MouseClick("left", 321, 203, 1, 1)
EndFunc

Good Luck

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
×
×
  • Create New...