Sign in to follow this  
Followers 0
autocasserole

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

4 posts in this topic

#1 ·  Posted (edited)

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>

while(_ispressed(01)
$pos = mousegetpos()
mousemove($pos[0], $pos[1]-5)
wend

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



while(_ispressed(01)

You have unbalanced brackets in this line.

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:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
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  
Followers 0