0
votes

I'm trying to write a script that will move my mouse pointer to various locations on the screen but I'm constantly getting the following error message:

Error Image

The full script is:

MouseClick($MOUSE_CLICK_LEFT, 777, 68, 1)
MouseClick($MOUSE_CLICK_RIGHT, 777, 68, 1)
MouseClick($MOUSE_CLICK_LEFT, 810, 126, 1)
MouseClick($MOUSE_CLICK_LEFT, 675, 35, 1)
Sleep (5000)
MouseClick($MOUSE_CLICK_RIGHT, 755, 640, 1)
MouseClick($MOUSE_CLICK_RIGHT, 780, 510, 1)
MouseClick($MOUSE_CLICK_LEFT, 935, 720, 1)
Sleep (250000)
MouseClick($MOUSE_CLICK_LEFT, 740, 690, 1)
MouseClick($MOUSE_CLICK_LEFT, 1064, 35, 1)
Sleep (10000)
MouseClick($MOUSE_CLICK_LEFT, 1265, 10, 1)
2

2 Answers

0
votes

You are probably missing the include for the constants $MOUSE_CLICK_LEFT and $MOUSE_CLICK_RIGHT.

Put the following line as the first line of your script:

#include <AutoItConstants.au3>
0
votes

Make sure that if you assign a hotkey to the perform the mouse click that you let go of the hotkey quickly. For example if your hot key was "Alt" + F8 and you didn't let go the "Alt" key quick enough you end up with an "Alt" + mouse click, which won't register the mouse click!

This will move the mouse and "left" click.

MouseClick("left",430,110,1,10) ;("button", x, y, clicks, speed)