Jump to content

Do/Until problem


Recommended Posts

Hello all!

I have this script:

If $v=2 Then
        do
            $coord = PixelSearch(0,0,1024,768,5210767)
            if not @error then
            $check = PixelGetColor($coord[0],$coord[1],0)
            If $check = 5210767 Then    
                MouseMove($coord[0],$coord[1], 0)
                $v=2
        EndIf
     until $v=2
    EndIf

When i want to run it, it says:

"Until" statement with no matching "Do" statement.:

until $v=2

how can i fix it?

Edited by wazze
Link to comment
Share on other sites

If $v=2 Then
        do
            $coord = PixelSearch(0,0,1024,768,5210767)
            if not @error then
            $check = PixelGetColor($coord[0],$coord[1],0)
            If $check = 5210767 Then    
                MouseMove($coord[0],$coord[1], 0)
                $v=2
        EndIf
     until $v=2
    EndIf

badly nested statements is the problem. there cannot be an overlap!!

Statement 1

Statement 2

/statement 2

/statement 1

try:

If $v=2 Then
   do
      $coord = PixelSearch(0,0,1024,768,5210767)
         if not @error then
            $check = PixelGetColor($coord[0],$coord[1],0)
               If $check = 5210767 Then
                  MouseMove($coord[0],$coord[1], 0)
                  $v=2
               EndIf
         EndIf
   Until $v = 2
EndIf

MDiesel

@AceGuy: I gave him the answer...

Edited by mdiesel
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...