Jump to content

Recommended Posts

Posted (edited)

I am using return PixelCheckSum in my script. I am attempting to check a pixelchecksum of an area, and I want it to return true, but if it returns false I don't want the script to end, I want it to do something else. How would I do this with autoit.

return PixelCheckSum($TitleScreen[1], $TitleScreen[2], $TitleScreen[3], $TitleScreen[4], $TitleScreen[5]) == $TitleScreen[0]
Edited by bvr
Posted (edited)

Return Value

Success: Returns the checksum value of the region.

Failure: Returns 0.

So maybe something like this?

If Not PixelCheckSum($TitleScreen[1], $TitleScreen[2], $TitleScreen[3], $TitleScreen[4], $TitleScreen[5]) Then
 ;; Do This..
Else
 ;; Do This Instead..
EndIf
<br>Or perhaps the example code here, PixelChecksum, will help some.<br> Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted (edited)

return PixelCheckSum($TitleScreen[1], $TitleScreen[2], $TitleScreen[3], $TitleScreen[4], $TitleScreen[5]) == $TitleScreen[0]
If @error Then
   MsgBox(64, 'Error', 'An error has occured with: PixelCheckSum()')
EndIf

I know that when you add in "If @error Then" it will override the @error crash with whatever you put in the if statement.

Edited by Epdmk

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
  • Recently Browsing   0 members

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