Sign in to follow this  
Followers 0
muzle6074

How can I exit this loop?

3 posts in this topic

Hi,

I have this loop that executes 12 times but if $BGEnd = true I want the for loop to exit so the script can continue to the next part. How can I do this? Here is my loop:

For $i = 12 to 1 Step -1
        Sleep(6000)
        $BGEndPixelColor=PixelGetColor(790, 710)
            If Hex($BGEndPixelColor, 6) = "690505" Then
            $BGEnd = True
        Else
            $BGEnd = False
        EndIf
    Next

Thanks for reading

- muzle6074

Share this post


Link to post
Share on other sites



ExitLoop looks like what you're wanting.

For $i = 12 to 1 Step -1
        Sleep(6000)
        $BGEndPixelColor=PixelGetColor(790, 710)
            If Hex($BGEndPixelColor, 6) = "690505" Then
            $BGEnd = True
            ExitLoop
        Else
            $BGEnd = False
        EndIf
    Next

Share this post


Link to post
Share on other sites

Thanks for the quick response Arketh :)

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