Guest nait Posted June 26, 2005 Share Posted June 26, 2005 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 More sharing options...
MSLx Fanboy Posted June 26, 2005 Share Posted June 26, 2005 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()) Link to comment Share on other sites More sharing options...
buzz44 Posted June 26, 2005 Share Posted June 26, 2005 (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 June 26, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 26, 2005 Share Posted June 26, 2005 hehe, i didn't even catch that...sorry Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
quick_sliver007 Posted June 26, 2005 Share Posted June 26, 2005 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 More sharing options...
buzz44 Posted June 26, 2005 Share Posted June 26, 2005 Thanks quick_sliver007, I replied in a rush and must of overlooked. qq Link to comment Share on other sites More sharing options...
quick_sliver007 Posted June 26, 2005 Share Posted June 26, 2005 Thanks quick_sliver007, I replied in a rush and must of overlooked.<{POST_SNAPBACK}>You welcome, I do the same thing sometimes and end up tring to edit the post before someone see it. . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now