Sign in to follow this  
Followers 0
tellme

Visual Basic,how can i do While or Loop also include pixelsearch?

2 posts in this topic

This is my vb6 function's some part, and its working but its only sending key once time and pixelsearch working once time to then just stopping,

İ'm trying to do, if checkbox checked then all time look for the pixelsearch and if pixelsearch true then alltime send key. Sorry for my english. Thanks for all help and have a nice forum...

 

Private Sub Check5_Click()
If Check5.Value = 1 Then
    Call example
    End If
End Sub

Function example()
  asd = autoit.PixelSearch(12, 21, 12, 21, &H0)
    If IsArray(asd) = True Then
    Sleep 2000
    SendKeys ("0")
    Else
    End If
End Function

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If I'm understanding correctly, you would want to do

While IsArray(asd) = True

      Sleep 2000

      SendKeys("0")

Wend

That way it will continue to check the pixel, instead of just checking one time.

 

Depending on how the pixel search works, try...

asd = autoit.PixelSearch(12, 21, 12, 21, &H0)

While IsArray(asd) = True

      Sleep 2000

      SendKeys("0")

      asd = autoit.PixelSearch(12, 21, 12, 21, &H0)

Wend

This will lead into the while loop, and inside the loop it will re-check.

Edited by Sori

If you need help with your stuff, feel free to get me on my Skype.

I often get bored and enjoy helping with projects.

Share this post


Link to post
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
Sign in to follow this  
Followers 0