Sign in to follow this  
Followers 0
hotwings

Stupid Noob Question

6 posts in this topic

I've entered the wonderful world of scripting now! Woohoo!

I cant understand that you can do SOO much with scripting, its amazing, im excited.

Well i wrote this program, and i was wondering if there was a command that just repeats your program after it finishes going through. (Instead of closing). Any fast help would be great.

Share this post


Link to post
Share on other sites



While 1
   ;your code here
Wend

that will repeat your code over and over and over in an infinite loop

Share this post


Link to post
Share on other sites

Ok i was trying to understand the WHILE loop in this program, now i understand it. Its much different than C++ heh, thanks for the fast reply.

Share this post


Link to post
Share on other sites

I had some help from a friend, but now hes offline. Heres where i got to:

#include <Misc.au3>

$dll = DllOpen("user32.dll")




    
    While 1
    Sleep ( 0 )
    If _IsPressed("01", $dll) Then
        $i = 1
        ExitLoop
    EndIf
WEnd
DllClose($dll)

While $i < 10; Amount of times mouse button is clicked
   MouseClick("left")
   Sleep(500); Time between clicks in m/s (now 1sec)
   $i = $i+1
WEnd

I want the whole thing to repeat, when i put a while loop around it, it doesnt seem to work, maybe im doing it wrong.

Share this post


Link to post
Share on other sites

#include <Misc.au3>

$dll = DllOpen("user32.dll")
While 1
    While 1
        Sleep(100)
        If _IsPressed("01", $dll) Then
            $i = 1
            ExitLoop
        EndIf
    WEnd

    While $i < 10; Amount of times mouse button is clicked
       MouseClick("left")
       Sleep(500); Time between clicks in m/s (now 1sec)
       $i = $i+1
    WEnd
WEnd
DllClose($dll)

That should work. I didn't test it though.

Share this post


Link to post
Share on other sites

Yay! I get it now too. Man scripting is so fun hehe. Thanks a ton, ill be back soon!

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