Sign in to follow this  
Followers 0
tao

experiencing problems with getsum

2 posts in this topic

I am currently working on my first project using AutoIt. I am new to the language.

I am experiencing problems using the PixelCheckSum function. It seems that even though there are drastic changes in the target area, the function is not registering the change, and returning the same value. Here is the relevant portion of my code:

global $checksum;

WinMinimizeAll();

$checksum = PixelChecksum(530,560, 590,580);

MsgBox(0, "Sum0", $checksum, 3);

Run("C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe", "C:\Program Files\Wizards of the Coast\Magic Online III");

WinWaitActive("Magic Online 3.0"); ;Note: at this point, a large graphic pops up in the middle of the screen.

$checksum = PixelChecksum(530,560, 590,580);

MsgBox(0, "Sum1", $checksum, 3);

Both returned values are identical.

Now, I have tried some alternative coding to attempt to debug:

1) I've considered that my pixel range was for some reason not incorporating the huge graphic that pops up in the middle of the screen. I changed the range in checksum to (0,0, 1200, 700). There is still no change between the two function calls.

2) I've added a checksum call prior to minimizing all windows. In this case, there is a unique returned value prior to minimization (i.e. one taken while the script editor is still maximized). However, the value for the checksum of my desktop wallpaper, while different from the one taken of the script editor, still doesn't change after the target program is called and initialized (after the graphic pops up).

Any ideas???

Thanks,

Ben

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I am currently working on my first project using AutoIt. I am new to the language.

I am experiencing problems using the PixelCheckSum function. It seems that even though there are drastic changes in the target area, the function is not registering the change, and returning the same value. Here is the relevant portion of my code:

global $checksum;

WinMinimizeAll();

$checksum = PixelChecksum(530,560, 590,580);

MsgBox(0, "Sum0", $checksum, 3);

Run("C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe", "C:\Program Files\Wizards of the Coast\Magic Online III");

WinWaitActive("Magic Online 3.0"); ;Note: at this point, a large graphic pops up in the middle of the screen.

$checksum = PixelChecksum(530,560, 590,580);

MsgBox(0, "Sum1", $checksum, 3);

Both returned values are identical.

Now, I have tried some alternative coding to attempt to debug:

1) I've considered that my pixel range was for some reason not incorporating the huge graphic that pops up in the middle of the screen. I changed the range in checksum to (0,0, 1200, 700). There is still no change between the two function calls.

2) I've added a checksum call prior to minimizing all windows. In this case, there is a unique returned value prior to minimization (i.e. one taken while the script editor is still maximized). However, the value for the checksum of my desktop wallpaper, while different from the one taken of the script editor, still doesn't change after the target program is called and initialized (after the graphic pops up).

Any ideas???

Thanks,

Ben

I don't think that your game initiated in 5 seconds.

Try this;

WinWaitActive("Magic Online 3.0", 15);;Note: at this point, a large graphic pops up in the middle of the screen.

If WinExists("Magic Online 3.0") = 0 Then
    MsgBox( 0, "error" , "title not fiund." )
Else
    While WinExists("Magic Online 3.0") = 1 AND NOT BitAND( WinGetState( "Magic Online 3.0" ) , 2 )
        Sleep( 200 )
    wEnd
EndIf
Edited by GoodMan

Share this post


Link to post
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
Sign in to follow this  
Followers 0