Jump to content
Sign in to follow this  
wazze

Do/Until problem

Recommended Posts

wazze

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

Share this post


Link to post
Share on other sites
Mat

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

Share this post


Link to post
Share on other sites
wazze

oops ^_^ thanks

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  

×