Andy2k14 Posted May 13, 2014 Share Posted May 13, 2014 Can anyone spot why my code is broken. It complains it is missing a Next statement. ;Poll pixel colour until SPTAC is set or 12 seconds has elapsed For $i = 1 To 12 Step +1 local $Status_Colour = PixelGetColor(24, 207) If $Status_Colour = 15790320 Then ExitLoop ElseIf $Status_Colour = 0 then MsgBox($MB_SYSTEMMODAL, "", "Please restart the application") Exit EndIf wait(1000) Next Thanks Link to comment Share on other sites More sharing options...
jguinch Posted May 13, 2014 Share Posted May 13, 2014 Your code is very strange... - the loop seems unnecessary - wait() si undefined The only warning we have here is an error saying "wait (1000) is an unknown function". Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JohnOne Posted May 13, 2014 Share Posted May 13, 2014 Use tidy on it ctrl + t. Sometimes it's a formatting problem, update scite to latest release. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Andy2k14 Posted May 13, 2014 Author Share Posted May 13, 2014 i need the loop to check for a colour change on a certain pixel. I am allowing 12 seconds for this to happen. If the pixel colour does not change within 12 seconds i want to script to exit. If the colour changes within 12 seconds the script is to continue as normal. I could just sleep for 12 seconds then do a pixel check but in my application the colour change can happen anywhere betyween 1 and 12 seconds. I save cycle time this way. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 13, 2014 Moderators Share Posted May 13, 2014 Same here as jguinch, please show your wait() function, or (better) the entire code, so we can see what you're trying to do. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Blue_Drache Posted May 13, 2014 Share Posted May 13, 2014 What JLogan said ... This loop is fine ... We need to see more code to diagnose the problem. Post all of it and we'll be able to help you. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
jguinch Posted May 14, 2014 Share Posted May 14, 2014 Andy2k14, I think you wanted to write Sleep(1000), instead of wait(1000) ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JustSomeone Posted May 14, 2014 Share Posted May 14, 2014 (edited) Can anyone spot why my code is broken. It complains it is missing a Next statement. ;Poll pixel colour until SPTAC is set or 12 seconds has elapsed For $i = 1 To 12 Step +1 local $Status_Colour = PixelGetColor(24, 207) If $Status_Colour = 15790320 Then ExitLoop ElseIf $Status_Colour = 0 then MsgBox($MB_SYSTEMMODAL, "", "Please restart the application") Exit EndIf wait(1000) Next Thanks ;Poll pixel colour until SPTAC is set or 12 seconds has elapsed For $i = 1 To 12 Step +1 local $Status_Colour = PixelGetColor(24, 207) If $Status_Colour = 15790320 Then ExitLoop ElseIf $Status_Colour = 0 then MsgBox($MB_SYSTEMMODAL, "", "Please restart the application") Exit EndIf Sleep(1000) Next this EDIT: keep in mind, this is bit more than 12 seconds >Exit code: 0 Time: 12.41 Edited May 14, 2014 by JustSomeone 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