Jump to content

How can I exit this loop?


Recommended Posts

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

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...