Dsmoeg999 Posted April 24, 2023 Share Posted April 24, 2023 I am checking a color in a region this color stays for a few seconds and then changes position. how can I determine if in the first position that color has changed? I want to save that position with the color and check if at that same point the color changes. This is more or less how I have thought about it, I don't know if it is a good idea. Func SearchColor() $color=0x000000 $searchArea=PixelSearch(324,320,1149,718,$color,2) if not (@error) Then $position=$searchArea EndIf if $position !=$searchArea Then MsgBox(0, "", "The position has changed!") EndIf Endfunc Link to comment Share on other sites More sharing options...
Solution ioa747 Posted April 24, 2023 Solution Share Posted April 24, 2023 like this ? Global $position = ColorPosition() ConsoleWrite("$position=" & $position & @CRLF) Sleep(3000) ConsoleWrite("$position=" & ColorPosition() & @CRLF) If $position <> ColorPosition() Then MsgBox(0, "", "The position has changed!") EndIf Func ColorPosition() Local $color = 0x000000 Local $searchArea = PixelSearch(324, 320, 1149, 718, $color, 2) If Not (@error) Then Return $searchArea[0] & ":" & $searchArea[1] Else Return SetError(1, 0, "") EndIf EndFunc ;==>ColorPosition Dsmoeg999 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Developers Jos Posted April 25, 2023 Developers Share Posted April 25, 2023 11 hours ago, Dsmoeg999 said: I am checking a color in a region this color stays for a few seconds and then changes position. how can I determine if in the first position that color has changed? Game stuff? 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...
Dsmoeg999 Posted April 25, 2023 Author Share Posted April 25, 2023 Hello @ioa747 thanks for the example as I understand when comparing we are comparing all parameters including color. if I am not mistaken. Link to comment Share on other sites More sharing options...
Dsmoeg999 Posted April 25, 2023 Author Share Posted April 25, 2023 @Jos I'm trying to learn by examples and I'm improving my programming that's all.From what I have read, it is very inaccurate for games. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 25, 2023 Developers Share Posted April 25, 2023 Great but you better now first read our forum rules again as that stipulates some stuff in relation to games. *Click* 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