Jump to content

Need some Help w PixelCheckSum or PixelGetColor


Recommended Posts

Hi Guys,

I'm quite new to Autoit and I hope you might help me ;-)

Okay,

I'm trying to detect a change in a specific Area on Screen, according to the manual this can be done with pixelchecksum

Code looks similar to this:

While 1
$pxcolor = PixelChecksum(680,80,690,85)
If $pxcolor == True Then
ToolTip('start', 500, 500)
Sleep(5000)
Else
    Sleep(10)
EndIf
WEnd

Does anyone have a clue how to get this to work?

Thanks in advance simrock

Sorry my english isn't the best, i know :)

Edited by simrock
Link to comment
Share on other sites

There's an example in the help file too-

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")

Your specific attempt might be coded as-

$chksum = PixelChecksum(680,80,690,85)
While 1
    $newchksum = PixelChecksum(680,80,690,85)
    If $chksum <> $newchksum Then
        ToolTip('start', 500, 500)
        Sleep(5000)
    Else
        Sleep(10)
    EndIf
WEnd

Depending on what you're trying to do.

Edited by evilertoaster
Link to comment
Share on other sites

There's an example in the help file too-

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")

Your specific attempt might be coded as-

$chksum = PixelChecksum(680,80,690,85)
While 1
    $newchksum = PixelChecksum(680,80,690,85)
    If $chksum <> $newchksum Then
        ToolTip('start', 500, 500)
        Sleep(5000)
    Else
        Sleep(10)
    EndIf
WEnd

Depending on what you're trying to do.

not to thread hijack- but it is along those lines. Do you think that autoscript would be smart enough to use the checksum for comparison of one icon to another?

As in, could I get the checksum for say, the Norton icon and then have autoscript scan the screen for it and then when it finds it click on it? or are there some user defined functions that could do the same thing? or I could make one if you guys give me an idea.

Link to comment
Share on other sites

not to thread hijack- but it is along those lines. Do you think that autoscript would be smart enough to use the checksum for comparison of one icon to another?

As in, could I get the checksum for say, the Norton icon and then have autoscript scan the screen for it and then when it finds it click on it? or are there some user defined functions that could do the same thing? or I could make one if you guys give me an idea.

There are UDF's for doign this-

http://www.autoitscript.com/forum/index.php?showtopic=16353

http://www.autoitscript.com/forum/index.php?showtopic=48333

http://www.autoitscript.com/forum/index.php?showtopic=52149

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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