Gissel Posted November 21, 2012 Share Posted November 21, 2012 Hello, im curretly trying to get my script to scan for one color in a cornor down to another color in a cornor, but it never seems to find the second color when reversing anyone who can help me? $Corner1 = pixelSearch(0,0,@DesktopWidth,@DesktopHeight, $CornerColor1,0) If @error Then msgbox(0,"","Top Left pixel with color: " & hex($CornerColor1, 6) & " not found ") exit Else MouseMove($corner1[0],$corner1[1]) endif _log("Searching bottom right position of playfield") ToolTip('Searching bottom right position pixel with color ' & hex($CornerColor4, 6) , 0, 0) $Corner4=_pixelSearchReverse(0,0,@DesktopWidth,@DesktopHeight, $CornerColor4) If @error Then msgbox(0,"","Bottom Right pixel with color: " & hex($CornerColor4, 6) & " not found") exit Else MouseMove($corner4[0],$corner4[1]) endif Func _pixelSearchReverse($left,$top,$right,$bottom,$color) $coordFoundColor=_ArrayCreate("-1","-1") $i = 0 $j = 0 for $i = @DesktopWidth to 0 Step -1 for $j = @DesktopHeight to 0 Step -1 $currentcolor = PixelGetColor($i,$j) if $currentcolor = $color then $coordFoundColor[0] = $i $coordFoundColor[1] = $j return $coordFoundColor endif next next SetError(-1) endFunc what am i doing wrong? Link to comment Share on other sites More sharing options...
Bert Posted November 21, 2012 Share Posted November 21, 2012 Well, seeing the word "playfield" makes me think you are trying to work with a game. As you know when you reviewed the forum rules on the way in to the forum, automating a game and discussing that subject in the forum is not allowed.Now, if you are not doing such a thing then please forgive me for implying otherwise but I must ask you a simple question - If you are working with an application that has controls have you tried to access the controls instead of just doing a pixel search? It is much easier to just interact with the controls. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2012 Developers Share Posted November 21, 2012 (edited) Seems the op hasn't read the forum rules since this is the same topic as a previously closed topic. Last warning. Edited November 21, 2012 by Jos 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...
Recommended Posts