jap4n Posted February 23, 2005 Share Posted February 23, 2005 (edited) 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 February 23, 2005 by jap4n Link to comment Share on other sites More sharing options...
Insolence Posted February 23, 2005 Share Posted February 23, 2005 (edited) 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 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 February 23, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now