Jump to content

Trouble with AU3_PixelChecksum


Recommended Posts

Hi I'm having trouble with AU3_PixelChecksum. There is a region that I'm taking the checksum of every time the image in the region changes. The problem is images that are clearly different are getting the same checksum value of 2147483648.

This is odd since it is obviously the max int value. So I'm wondering if it is a problem with the AU3_PixelChecksum function or something I'm doing wrong.

I'm calling it from C++.

Thanks for any help.

Link to comment
Share on other sites

Post your C++ source code to see if you are calling the AutoItX dll correctly(I am assuming that is what you are using). If you don't post your code, we can't help you because we can't guess what, if anything, you are doing wrong and cannot replicate the situation.

If you are worried about people stealing it, you really shouldn't worry. Anybody on this forum that could use the C++ code would most likely have no desire to do so, since they could always write their own code to do whatever it is that you are doing.

-The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

I'm pretty sure I'm calling it correctly since it returns values other than 2147483648 about half the time and every other AU3 function seems to work fine. Are you saying that you have used this function from C++ without problems?

char buf[512];

unsigned long lastCS=0;

unsigned long cs=AU3_PixelChecksum(14,338,270,574,1);

while(cs != lastCS)

{

AU3_Send("^c",0);

AU3_ClipGet(buf,512);

logMsg("%u : %s",cs,buf);

// arrow down this will change what is displayed

AU3_Send("{DOWN}",0);

Sleep(500);

lastCS=cs;

cs=AU3_PixelChecksum(14,338,270,574,1);

}

Link to comment
Share on other sites

  • Moderators

Are your coords relative to the actual area on the screen? Or are you trying to get the sums from within a client area?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

I'm trying to get them from the client area. Does that not work?

Of course it works, however, you aren't telling the function to look in the client area with your current code (at least I don't see it in the snippet you provided). You'll need to look at AutoItSetOption('PixelCoordMode', 2), and where to implement that in your current code.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Of course it works, however, you aren't telling the function to look in the client area with your current code (at least I don't see it in the snippet you provided). You'll need to look at AutoItSetOption('PixelCoordMode', 2), and where to implement that in your current code.

I call it elsewhere. That is not the problem since the checksum does change when the images change. The problem is that half the images have the same checksum of MAX_INT. Has anyone used the dll version of this function successfully?

Link to comment
Share on other sites

  • Moderators

I call it elsewhere. That is not the problem since the checksum does change when the images change. The problem is that half the images have the same checksum of MAX_INT. Has anyone used the dll version of this function successfully?

If they have the same checksum, then try using BitShift() with a few pixels in that area to make the sums/Pics unique.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I used the source code that is posted in the developer forum. It works fine. There is definitely a bug in the dll. The AU3_ version has some signed/unsigned problem that causes half the images to have the same checksum.

Edited by BlazeTucker
Link to comment
Share on other sites

  • 4 months later...

I used the source code that is posted in the developer forum. It works fine. There is definitely a bug in the dll. The AU3_ version has some signed/unsigned problem that causes half the images to have the same checksum.

We are receiving the same anomoly here as well. The version that we are using is 3.2.2.0

Has anyone from the autoit looked more closely into this bug? Is there a patch for it?

Even if pixelchecksum runs alot faster as the help file says, it doesn't do much if the function keeps on returning 2147483648. :)

Link to comment
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
 Share

  • Recently Browsing   0 members

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