Jump to content
Sign in to follow this  

Just need a little help with a script (Super newb)

Recommended Posts


hiya. I was using AHK and had a number of scripts working pretty well, but would like to use AutoIt instead for a few reasons.

Could someone help me get a pretty simple script working?

Its this:

#include <misc.au3>

$pos = mousegetpos()
mousemove($pos[0], $pos[1]-5)

After compiling it and trying to run it, it says
Line 380 (File "filelocation"):

Error: Missing right bracket ')' in expression.

So I guess I'm missing a right bracket, but I've no idea where to put it. I'm also not sure if the part that "while(ispressed" needs to specify the left mouse button. If so, how do I add that too?

I've tried a few things on my own and some have gotten rid of error messages, but result in the script not even running so that must of not been right. I've kind of run out of ideas and was failing to find the answer through searches so thought I'd ask here.

All the script should do is move the mouse while holding down left click.

Could you tell me what to do with it?

Edited by autocasserole

Share this post

Link to post
Share on other sites

Welcome to AutoIt and the forum!

Would you please be so kind to give meaningful titles to your threads? Because everyone on this forum is looking for help ;)

My UDFs and Tutorials:


Active Directory (NEW 2018-12-03 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki


Share this post

Link to post
Share on other sites

Both of the above posts are correct. You don't have a closing right bracket in the While line, and you should word the title of this thread more descriptively. Many people here just wont even look at a thread with a topic title like "need help with this script".

Technically you would only need one set of brackets anyway, for the _IsPressed function. Also, the script is written incorrectly in other ways, as well. The script will end right away unless the left mouse button (01 is the correct parameter, BTW)  is being pressed and held down when the script is started. This because the _IsPressed function is a parameter of the only While .. WEnd loop in your script.

Refer to the Help file for proper usage of the _IsPressed function, and the While .. WEnd loop. Your use of both of the mouse functions is correct.

Good luck, and as water said, welcome to the forum.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post

Link to post
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
Sign in to follow this