Sign in to follow this  
Followers 0
BraveSlice

How? Detect change in a game and read it?

4 posts in this topic

Hi all!

This is my first project with AutoIt, and I don’t have any experience with object oriented programming or in serious programming in any language, so bare with me.

What I’m trying to accomplish: I’m trying to read from a Chess Master program a last move made.

Moves are shown in a following format:
1. d2-d4    e7-e5
2. e2-e4    d7-d5
etc....

Windows explorer gives, when over the moves:

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:  Game Status
Class:  cguiDialogClass
Size:   X: 585  Y: 162  W: 241  H: 475

>>>>>>>>>>> Mouse Details <<<<<<<<<<<
Screen: X: 716  Y: 409
Cursor ID:  2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<
RGB:    Hex: 0x003C5A   Dec: 15450

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size:       X: 0    Y: 124  W: 229  H: 208
Control ID: 1806
ClassNameNN:    CGUIListWnd1
Text:       
>>>>>>>>>>> Status Bar Text <<<<<<<<<<<


>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
<
<<
X
>>
>
<|
|>

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

What I have tried to do1:

Dim $msg, $i 


While 1 = 1
    
   $msg = GUIGetMsg()
    If  $msg <> 0 Then
        MsgBox(0,"Something",$msg)
    EndIf   
WEnd

Result: Nothing happens

What I have tried to do2:

For $i = 0 To 1

$tila = ControlCommand ("Game Status", ">", 1806, "IsVisible", "")
msgbox(0,"IsVisible", $tila); display the value

$tila = ControlCommand ("Game Status", ">", 1806, "GetCurrentLine", "")
msgbox(0,"GetCurrentLine", $tila); display the value

$tila = ControlCommand ("Game Status", ">", 1806, "GetCurrentCol", "")
msgbox(0,"GetCurrentCol", $tila); display the value

$tila = ControlCommand ("Game Status", ">", 1806, "GetCurrentSelection", "")
msgbox(0,"GetCurrentSelection", $tila); display the value

$tila = ControlCommand ("Game Status", ">", 1806, "GetLineCount", "")
msgbox(0,"GetLineCount", $tila); display the value

$tila = ControlCommand ("Game Status", ">", 1806, "CurrentTab", "")
msgbox(0,"CurrentTab", $tila); display the value

msgbox(0,"Next Round", $tila); display the value

Next

Result: 1,1,1244797,1,0,1 and second time exactly same result.

Is there something wrong what I have tried, or is this just not possible to do?

Share this post


Link to post
Share on other sites



Hi all!

This is my first project with AutoIt, and I dont have any experience with object oriented programming or in serious programming in any language, so bare with me.

What Im trying to accomplish: Im trying to read from a Chess Master program a last move made.

Is there something wrong what I have tried, or is this just not possible to do?

it doesn't look like the data in the moves list is visible to autoit, so you have a couple of options. The hardest of the options would be to code your own OCR, but even that wouldn't be real hard since you only have 20 or so chars to identify. there are a few OCR scripts in scripts and scraps you could look to for examples. a much easier solution (although possibly more time consuming) if your game lets you save the move list, or export the list to a plain text file, you could then easily read in the text file.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

.... much easier solution (although possibly more time consuming) if your game lets you save the move list, or export the list to a plain text file, you could then easily read in the text file.

Yes, thx, I think I will try this first. It IS a bit time consuming considering that it has to be polled on and on. However, it wins OCR hands down :lmao:

try memory-reading it ;)

o:) Maybe someday (I read your mem script).

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