autocasserole Posted July 13, 2014 Share Posted July 13, 2014 (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 saysLine 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 July 13, 2014 by autocasserole Link to comment Share on other sites More sharing options...
Danp2 Posted July 13, 2014 Share Posted July 13, 2014 while(_ispressed(01) You have unbalanced brackets in this line. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
water Posted July 13, 2014 Share Posted July 13, 2014 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 13, 2014 Share Posted July 13, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now