Jump to content

Recommended Posts

Posted

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

Posted

No EndIf statement, it looks through the entire script for EndIf first, so WEnd is skipped because End-of-File is already reached

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted (edited)

@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

Posted

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

.

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
  • Recently Browsing   0 members

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