Jump to content

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


tellme
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

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