inester 0 Posted March 5, 2004 Share Posted March 5, 2004 Ok I'm sure this is a really easy one... thats whats driving me nuts about it... First off, It is not letting me declare the y variable... Can someone give me the skinny on declaring multiple variables? Also, since I'm at work I don't have access to the Autoit... do we have online documentation or access to the help file? (my firewall won't let me download the program again) (I put the correct declaration statement here, but I forgot it )$y = 0, $x = 500 Do $y = $y + 1 For $x = 6 to 1 Step -1 MouseDown("left") MouseUp("left") Next Until $y = 20 Finally, I want to "reuse" both of these variables but I'm pretty sure the way in which I'm declaring them, the X variable will be destroyed before the first Y variable iteration. The ultimate goal for this Script is to "double click" three times, so I changed my mouse buttons to that the left click is mapped as double click... is there an easier way to "double click" Thanks for the responses "So... when you program stuff, it takes ten times longer than if you were to just to do the work yourself in the first place?"-inester's wife on the concept of computer programming Link to post Share on other sites
Developers Jos 2,852 Posted March 5, 2004 Developers Share Posted March 5, 2004 For $x = 6 to 1 Step -1to declare both variables and set them initially you do:Dim $y = 0Dim $x = 500but your: For $x = 6 to 1 Step -1 will set the $x to 6 the first time its executed. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to post Share on other sites
inester 0 Posted March 5, 2004 Author Share Posted March 5, 2004 ahh rats! I was doing them both on the same line Dim $y = 0, $x = 6 I'm assuming that was the error... as far as calling the next in the for statement... do I have to specify $x? "So... when you program stuff, it takes ten times longer than if you were to just to do the work yourself in the first place?"-inester's wife on the concept of computer programming Link to post Share on other sites
Developers Jos 2,852 Posted March 5, 2004 Developers Share Posted March 5, 2004 I am not sure why you use the for $x = 6 to 1 step -1 .... the statements you have between the for and next don't refer to any variable. I would have expected a mousemove or something.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to post Share on other sites
Valik 481 Posted March 5, 2004 Share Posted March 5, 2004 ahh rats!I was doing them both on the same lineDim $y = 0, $x = 6I'm assuming that was the error...as far as calling the next in the for statement... do I have to specify $x?Dim $y = 0, $x = 6 should work. Multi-variable assignment on a single line was implemented several beta versions back. Link to post Share on other sites
Valik 481 Posted March 5, 2004 Share Posted March 5, 2004 How about a little re-write to make things a little easier to understand... For $y = 0 To 20 For $x = 6 To 1 Step -1 MouseDown("left") MouseUp("left") Next Next Now, unless you actually need x or y outside of those For loops, you don't even have to declare them. Link to post Share on other sites
GrahamS 0 Posted March 6, 2004 Share Posted March 6, 2004 The ultimate goal for this Script is to "double click" three times, so I changed my mouse buttons to that the left click is mapped as double click... is there an easier way to "double click"Try MouseClick ( "left", $x, $y, 2 ) where $x & $y are the pixel coordinates where you want to click GrahamS Link to post Share on other sites
inester 0 Posted March 8, 2004 Author Share Posted March 8, 2004 You guys are MONEY! When I used the next statements... I kept specifying which variable I wanted to loop i.e. Next $x. I believe this was the problem I was running into... Now, unless you actually need x or y outside of those For loops, you don't even have to declare them.Well... It depends on if the variables are still usable after this loop completes... Let me rewrite it... For $y = 0 To 20 For $x = 5 To 1 Step -1 MouseClick ( "left", xcord, ycord, 2 ) Next Sleep (1800000) [COLOR=blue]<------30 minutes right?[/COLOR] Next <I plan on calling another script here> <end of above script will start this script again> So I'm guessing after this loop completes the value of x will be 1... I was thinking I would have to declare it in order for the first loop to see it as 500 again.. I guess not? Thanks for all the help everyone! "So... when you program stuff, it takes ten times longer than if you were to just to do the work yourself in the first place?"-inester's wife on the concept of computer programming Link to post Share on other sites
Developers Jos 2,852 Posted March 8, 2004 Developers Share Posted March 8, 2004 So I'm guessing after this loop completes the value of x will be 1... I was thinking I would have to declare it in order for the first loop to see it as 500 again.. I guess not?The value of $x will be 500 till it gets to the for $x= statement. Then it will be set to 5 in the first cycle.When the For $x is finished and for $y is finished, $x will indeed be 1.I am still a bit lost about what you want to do ... I assumed you would do something like MouseClick ( "left", $x, $y, 2 ) in the for...next loops. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to post Share on other sites
inester 0 Posted March 8, 2004 Author Share Posted March 8, 2004 I am still a bit lost about what you want to do ...click a few times, wait 30 minutes, click a few more times... for 10 hours the use of 500, 5, and all the other values are arbitrary, I just wanted to understand how autoit would read my variable declarations... I'm sorry about the mixed signals. "So... when you program stuff, it takes ten times longer than if you were to just to do the work yourself in the first place?"-inester's wife on the concept of computer programming Link to post Share on other sites
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