Sign in to follow this  
Followers 0
simrock

Need some Help w PixelCheckSum or PixelGetColor

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks,

This did the clue

After i found out that the checksum didn't give a bool (*head hits table*) i tried to figure out which value it had, but this solution is far far more simple and better ;-)

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0