GetRectCheckSum


 

GetRectCheckSum>TLX,TLY,BRX,BRY,result_value

 

When passed the top left and bottom right screen coordinates of a rectangle, this function returns the checksum of that rectangle.  The checksum is based on the color and position in the rectangle of each individual pixel.  The checksum is returned in the variable result_value.

 

This command will allow for waiting for a specific part of the screen to become equal to a known graphic.  Use the command when the graphic to be compared against is present to determine it's checksum.  The example below shows a loop which will cause the script to wait until the rectangle contains the required graphic.

 

TLX - Top Left corner X coordinate

TLY - Top Left corner Y coordinate

BRX - Bottom Right corner X coordinate

BRY - Bottom Right corner Y coordinate

 

This function was optimized in version 10 to improve performance and now operates very quickly, taking around 0.1 second to scan a 500x500 area of screen.  However, on some systems it may consume a lot of CPU cycles in the process.  If you need to force the function to yield to the system more you can set GRC_YIELD to 1, but this will have the side effect of slowing the function down, as it gives over CPU time to other processes.

 

Abbreviation : GRC

See also: WaitRectChanged, WaitPixelColor, GetPixelColor

 

Example

 

Label>waitforit

GetRectCheckSum>10,10,15,15,cs

If>cs=6.20066481623195E16,Done

Goto>waitforit

Label>Done

Message>There You Go