Vindicator Posted November 18, 2006 Share Posted November 18, 2006 I know someone is going to tell me to make a better title, but I literally dont know what my problem IS. so basically, Im trying to make a script look for a color and click it. and if it doesnt find it, then try and find a different color, but instead, when my script DOESNT find the color, it just give me an error. why? and how can I fix it? Func search() $pix1=PixelSearch(15,128,876,464,1453099) $pix=PixelSearch(15,128,876,464,0) If $pix1[0] > 0 Then If $pix1[1] > 0 Then MouseClick("left",$pix1[0],$pix1[1]) Sleep(1000) EndIf Else $pix1=PixelSearch(15,128,876,464,1453099) $pix=PixelSearch(15,128,876,464,0) If $pix[0] > 0 Then If $pix[1] > 0 Then MouseClick("left",$pix[0],$pix[1]) Sleep(1000) EndIf EndIf EndIf EndFunc If I hadn't said thank you yet, and you deserve it, than thank you... Link to comment Share on other sites More sharing options...
Developers Jos Posted November 18, 2006 Developers Share Posted November 18, 2006 (edited) You didn't tell us what the error is but guess its an Array error on "If $pix1[0] > 0 Then"? You need to test the returned @error ! Failure: Sets @error to 1 if color is not found. Edited November 18, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Vindicator Posted November 18, 2006 Author Share Posted November 18, 2006 was that in the help file? I obviously missed it then... thanks! If I hadn't said thank you yet, and you deserve it, than thank you... 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