Jump to content

PixelChecksum()


Recommended Posts

On the initial screen for MTGO, there is a Launch button. At first, it is grayed out until some things initialize, then it changes color to show it is a button you can click. When you hover over it, it changes color yet again. However, the following code returns the same checksum no matter what state the button is in. Am I doing something wrong?

;open MTGO
 Run("C:\Program Files\Wizards of the Coast\Magic Online III\Renamer.exe","C:\Program Files\Wizards of the Coast\Magic Online III")
;Wait for MTGO to open
 WinWaitActive("Magic Online 3.0")
;Move the mouse out of the way
 MouseMove(0,0)
;get the first checksum, while the button is grayed out
 $test = PixelChecksum(407,550,410,555)
;wait for initialization
 Sleep(20000)
;get the next checksum, with the button ready to be clicked
 $test1 = PixelChecksum(407,550,410,555)
;move the mouse over the button
 MouseMove(380,555)
;get the checksum with the mouse over the button
 $test2 = PixelChecksum(407,550,410,555)
;show a MsgBox with the first value as the title, and the second value as the text
 MsgBox(0,$test,$test1)
;show a MsgBox with the second value as the title, and the third value as the text
 MsgBox(0,$test1,$test2)

$test has the same value as $test1 and $test2. What am I doing wrong?

Link to comment
Share on other sites

Even more frustrating is the following code.

;move the mouse out of the way
MouseMove(0,0)
;get the pixel color of two pixels on the screen
$test = PixelGetColor(493,459)
$another = PixelGetColor(410,561)
;launch MTGO and wait for it to activate
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")
;get the pixel color of the same pixels after MTGO has launched
$test1 = PixelGetColor(493,459)
$another1 = PixelGetColor(410,561)
;move the mouse to hover over the button
MouseMove(400,558)
;wait for MTGO to initialize
Sleep(20000)
;get the pixel color of the same pixels with the mouse hovering over the button
$test2 = PixelGetColor(493,459)
$another2 = PixelGetColor(410,561)

;Open  a file for writing
$file = FileOpen("test.txt", 2)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0,"Oops", "File did not open")
EndIf

;Write all the variables to a file so they can be easily viewed
FileWriteLine($file, "Test = " & $test)
FileWriteLine($file, "Another = " & $another)
FileWriteLine($file, "Test1 = " & $test1)
FileWriteLine($file, "Another1 = " & $another1)
FileWriteLine($file, "Test2 = " & $test2)
FileWriteLine($file, "Another2 = " & $another2)
    
;close the file
FileClose($file)

The file output looks like this...

Test = 16777215
Another = 16777215
Test1 = 16777215
Another1 = 16777215
Test2 = 16777215
Another2 = 16777215

So, all the pixels are the same color all the time? They should at least change when MTGO starts up...

Link to comment
Share on other sites

  • 6 months later...

Snippet from my MTGO3_Autologin.au3

While ControlCommand("Magic Online 3.0","Launch",iLaunchButtonControlID,"IsEnabled") <> 1
Sleep(5); slaughter CPU hog
WEnd
ControlClick("Magic Online 3.0","Launch",iLaunchButtonControlID)
Edited by abb
Link to comment
Share on other sites

This problem is in transparency of initial window. Your PixelChecksum will return checksum value from window under MTGO. If you want to share your experience with me, please contact me.

If I asked for help, would you wait 6 months to respond?

MrTieDye Posted Jan 6 2008, 12:05 AM

Durovec Posted Jul 9 2008, 03:49 AM

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
Share on other sites

  • Moderators

If I asked for help, would you wait 6 months to respond?

If you asked for help, no one would respond in 6 years ... They'd be afraid to get a ticket on the short bus muttley ...

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

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...