Jump to content

Hi guys, I need an idea to check a change in a region.


Go to solution Solved by ioa747,

Recommended Posts

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

  • Solution

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

 

I know that I know nothing

Link to comment
Share on other sites

  • Developers
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

  • Developers

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

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...