Jump to content
Sign in to follow this  
Hunterr

pixelSearch

Recommended Posts

Hunterr

$coor = PixelSearch( 326, 274, 330, 279, 0xE65E5E, 5, 5 )

if @error=0

Then

send ("w")

EndIf

hi, I liked to do something like this but allways gets error... can some one help me? or is there an other way so I can find a pixel of a certain color in a small square and do something if it finds it? thanks in advance

Edited by Hunterr

Share this post


Link to post
Share on other sites
PsaltyDS

What error do you get? The keyword "Then" belongs on the same line with the test condition:

$coor = PixelSearch(326, 274, 330, 279, 0xE65E5E, 5)
if @error=0 Then
     send ("w")
EndIf

Otherwise, it should work.

:mellow:

Edit: You also should not be using step 5 when your box is smaller than that (the seventh parameter).

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
shaqan

wrote program for similar purpose.. starts pinging when detects certain green dot in radar area..

Ill just dump whole function for you (sorry too tired atm to clean up unnecessary for you), maybe it makes some sense (and sorry its messy but it works though)

Func ActivateScan()
    If $hk_in_use = 0 Then
        Switch GUICtrlRead($SelectResCombo)
            Case "Select 3D resolution ingame"
                If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
                $iMsgBoxAnswer = MsgBox(16, "Error", "Please select your Entropia Universe graphics resolution from drop down menu before trying to activate scanning!", 1)
                Select
                    Case $iMsgBoxAnswer = -1
                EndSelect
            Case Else
                $hk_in_use = 1
                SoundPlay(@ScriptDir & "\Sounds\Start.wav", 1)
                While 1
                    $coord = PixelSearch($UpperLeftX, $UpperLeftY, $BottomRightX, $BottomRightY, 0x4CFA15, 80, 2) ;Green Dot Color Code 0x4cfa15
                    If Not @error Then
                        SoundPlay(@ScriptDir & "\Sounds\notify.wav", 1)
                    EndIf
                    If $hk_in_use = 0 Then
                        ExitLoop
                    EndIf
                WEnd
        EndSwitch
    EndIf
EndFunc   ;==>ActivateScan
Edited by shaqan

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  

×