narayanjr Posted May 23, 2007 Share Posted May 23, 2007 $coord = PixelSearch( 400, 300, 710, 435, 3749945, 50 ) If Not @error Then MouseMove ($coord[0] , $coord[1],1) sleep(100) MouseClick("left") Sleep(100) MouseMove (300, 250, 1) Sleep(120) MouseClick("left") EndIf it works fine if it fines the object but if it cant find it then i get an error msg how do i make it ignore the fact that it couldnt find it? Thanks Link to comment Share on other sites More sharing options...
Zedna Posted May 23, 2007 Share Posted May 23, 2007 (edited) Your code snippet seems to be OK.So problem is somewhere outside.Post your whole script.EDIT:And what exactly error message say? Edited May 23, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
narayanjr Posted May 23, 2007 Author Share Posted May 23, 2007 sleep(5000) ; Script Start - Add your code below here opt("PixelCoordMode", 2) opt("MouseCoordMode", 2) opt("ColorMode", 1) ;$var = PixelGetColor( 665 , 417 ) ;MsgBox(0,"The decmial color is", $var) ;MsgBox(0,"The hex color is", Hex($var, 6)) $coord = PixelSearch( 400, 300, 710, 435, 3749945, 50 ) If Not @error Then MouseMove ($coord[0] , $coord[1],1) sleep(100) MouseClick("left") Sleep(100) MouseMove (300, 250, 1) Sleep(120) MouseClick("left") EndIf well thats all and i just tried it again and it totally stopped working then i just undid it until the last time time i new it work and now it works fine for some reason but thanks for trying to help Link to comment Share on other sites More sharing options...
acidfear Posted May 24, 2007 Share Posted May 24, 2007 (edited) I think the fix for the error that you might not have noticed you put in after the pixelsearch function, which doesn't create an error if no pixel is found (it just moves to the next piece of code), is: $coord = PixelSearch( 400, 300, 710, 435, 3749945, 50 ) If not @error Then ;Code here if pixel is found EndIf ;Code here if pixel not found Edited May 24, 2007 by acidfear 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