Jump to content

pixelsearch and rectangle help


jap4n
 Share

Recommended Posts

Hi, I want to make a script that press the delete button when it see two pixels. I have the dimensions of the rectangle, but the script won't press the button even though that pixel is within the rectangle.

Sometimes it does press the delete button when the pixel is on the very far end or the x1(Left) coordinate. Are my rectangle coordinates placed wrong or is my program written incorrectly?

Here is my code:

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

For $i = 10000 to 1 Step -1

$coord = PixelSearch( 140, 280, 520, 360, 0x315563, 10 )

If Not @error Then

Send("{DEL}")

else

Endif

$coord = PixelSearch( 140, 280, 520, 360, 0xDE9AAD, 10 )

If Not @error Then

Send("{DEL}")

else

Endif

Next

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

Any advice would be helpful. Thanks.

Edited by jap4n
Link to comment
Share on other sites

Looks good to me, except for the blank 'else', try resizing the pixelsearch.

Try posting it inside the code tags... and please, for god sakes, format your code :lmao:

For $i = 10000 To 1 Step - 1
    $coord = PixelSearch(140, 280, 520, 360, 0x315563, 10)
    
    If Not @error Then
        Send("{DEL}")
    EndIf
    
    $coord = PixelSearch(140, 280, 520, 360, 0xDE9AAD, 10)
    
    If Not @error Then
        Send("{DEL}")
    EndIf
Next

No need for spaces inbetween everything, makes it hard to read.

EDIT:

What's with the shade variation? Should be pretty static? Could you include a picture of what you're scanning?

Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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...