simrock 0 Posted October 8, 2007 (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 October 8, 2007 by simrock Share this post Link to post Share on other sites
evilertoaster 3 Posted October 8, 2007 (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 October 8, 2007 by evilertoaster Share this post Link to post Share on other sites
simrock 0 Posted October 8, 2007 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
koresho 1 Posted October 8, 2007 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
evilertoaster 3 Posted October 8, 2007 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=16353http://www.autoitscript.com/forum/index.php?showtopic=48333http://www.autoitscript.com/forum/index.php?showtopic=52149 Share this post Link to post Share on other sites