Sign in to follow this  
Followers 0
inester

On To The Questions!

10 posts in this topic

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 :whistle: )$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 B)


"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

Share this post


Link to post
Share on other sites



For $x = 6 to 1 Step -1

to declare both variables and set them initially you do:

Dim $y = 0

Dim $x = 500

but your: For $x = 6 to 1 Step -1 will set the $x to 6 the first time its executed.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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?

Dim $y = 0, $x = 6 should work. Multi-variable assignment on a single line was implemented several beta versions back.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ... :whistle:

I assumed you would do something like MouseClick ( "left", $x, $y, 2 ) in the for...next loops.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 :whistle:

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

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