Sign in to follow this  
Followers 0
tellme

PixelSearch on VisuanBasic 6.0 or 2010

6 posts in this topic

Func 1()
    $example = PixelSearch(548,450, 548,450, 0x5A3C32)
    If IsArray($example) = True Then
        Send("Hello")
    EndIf
EndFunc

----------------------------------------

This is the true function for autoit but when comes VisualBasic 6 or 2010;

Dim autoit As New AutoItX3Lib.AutoItX3

'autoit.PixelSerch(nLeft As Long, nTop As Long, nRight As Long, nBottom As Long, nCol As Long, [nVar As Long], [nStep As Long = 1])

'in VisuaiBasic PixelSearch need to be like that, if i write like autoit:

---------------------------------------

autoit.PixelSerch(548,450, 548,450, 0x5A3C32)

'The color always wrong. İf anyone can help about that, I would be grateful... Thanks for all and sorry for my english.

Share this post


Link to post
Share on other sites



Dim autoit As New AutoItX3Lib.AutoItX3
Dim x As Integer

Private Sub Check1_Click()
If Check1.Value = 1 Then
x = autoit.PixelSearch(548,450,548,450,0x5A3C32)
autoit.Run (notepad.exe)
autoit.Sleep (1000)
autoit.Send ("hello")
End If
End Sub

--------------------

i dont know even this script is true on VisualBasic, but this is what i want to do and red place is wrong, the error is " Compile error: Expected: list sperator or ) "

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Syntax error from " x = autoit.PixelSearch(548,450,548,450,0x5A3C32) " this line. Probably color is wrong, my opinion vb is not supporting this color and i tryed to write color like HEX: VB,RGB, i dont know it was true or not but just tryed. Thaks a lot for trying to help.

Edited by tellme

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Dim autoit As New AutoItX3Lib.AutoItX3
Dim x As Variant


Private Sub Check1_Click()
If Check1.Value = 1 Then
x = autoit.PixelSearch(100, 588, 100, 588, &H0)

If IsArray (x) = True Then
autoit.Run ("notepad.exe")
autoit.Sleep (1000)
autoit.Send ("hello")
End If

End If
End Sub

İ Solved it. Dim x need to be variant and color need to be write with " &H " sign. Thanks for all.


 

Edited by tellme

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