Jump to content

Recommended Posts

Posted

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

 

Posted

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.

Posted

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

Posted (edited)
  On 5/13/2014 at 1:12 PM, Andy2k14 said:

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 by JustSomeone

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