simrock Posted October 8, 2007 Share 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 Link to comment Share on other sites More sharing options...
evilertoaster Posted October 8, 2007 Share 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 Link to comment Share on other sites More sharing options...
simrock Posted October 8, 2007 Author Share 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 ;-) Link to comment Share on other sites More sharing options...
koresho Posted October 8, 2007 Share 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. Link to comment Share on other sites More sharing options...
evilertoaster Posted October 8, 2007 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now