Jump to content

While-Loop for Noobs


Guest nait
 Share

Recommended Posts

Hi!

If i want to let the following script run, it says

"WEnd" statement with no matching "While" statement

Heres the code:

$count = 1
While $count = 1
    If PixelGetColor( 770 , 473 ) = 7701591 Then
    MouseClick ( "left", 720, 475)
    else $count = 0
WEnd

What did i do wrong?

thx in advance

Link to comment
Share on other sites

@nait

Cough... I think you forgot something.

Fixed version your code...

$count = 1
While $count = 1
   If PixelGetColor( 770 , 473 ) = 7701591 Then
      MouseClick ( "left", 720, 475)
   Else
      $count = 0
   EndIf
WEnd

Personal way of doing it...

While 1
   If PixelGetColor( 770 , 473 ) = 7701591 Then
      MouseClick ( "left", 720, 475)
      ExitLoop
   EndIf
WEnd
Edited by Burrup

qq

Link to comment
Share on other sites

Personal way of doing it...

While 1
   If PixelGetColor( 770 , 473 ) = 7701591 Then
      MouseClick ( "left", 720, 475)
      ExitLoop
   EndIf
WEnd

<{POST_SNAPBACK}>

I think he wants to exitloop if the pixel doesn't match.

like.....

While 1
    If PixelGetColor( 770 , 473 ) <> 7701591 Then 
        ExitLoop
    EndIf
    MouseClick ( "left", 720, 475)
WEnd

.

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...