Sign in to follow this  
Followers 0
Div

Trouble Recognizing Cards in Poker Game

7 posts in this topic

I've been using AutoIT for a good two years and while I'm not an expert, I like to consider myself at least a novice. I'm currently deployed to Iraq and I have been challenging myself with different goals for my AutoIT scripts, however, I've hit a roadblock.

I want to get the cards that come out on the flop, turn and river in a poker game. I have a couple of ways to accomplish this, however, I don't which one would be best. Here's my options as I see them:

+ use an OCR (I can't seem to find one that compares images for a match, only one that recognizes text in an image)

+ glean the information from the textbox (This will work, however, there is also alot of garbage in this textbox to weed through)

+ use PixelChecksum (I don't think this will even work as I have read multiple times that it only shows a change in a range of pixels)

+ find the memory pointers for the cards (I beat my head against the wall for about four hours trying this one)

That's all I can think of. I'm leaning towards the textbox method, since I have a good amount of experience using the string function in AutoIT. I just wanted to see if anyone had any unturned stone when approaching this problem before I devoted the time to a specific approach.

You know what they say: Two heads (or two hundred) is better than one.

Very Respectfully,

Div

Al Taqaddum, Iraq

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I've been using AutoIT for a good two years and while I'm not an expert, I like to consider myself at least a novice. I'm currently deployed to Iraq and I have been challenging myself with different goals for my AutoIT scripts, however, I've hit a roadblock.

I want to get the cards that come out on the flop, turn and river in a poker game. I have a couple of ways to accomplish this, however, I don't which one would be best. Here's my options as I see them:

+ use an OCR (I can't seem to find one that compares images for a match, only one that recognizes text in an image)

+ glean the information from the textbox (This will work, however, there is also alot of garbage in this textbox to weed through)

+ use PixelChecksum (I don't think this will even work as I have read multiple times that it only shows a change in a range of pixels)

+ find the memory pointers for the cards (I beat my head against the wall for about four hours trying this one)

That's all I can think of. I'm leaning towards the textbox method, since I have a good amount of experience using the string function in AutoIT. I just wanted to see if anyone had any unturned stone when approaching this problem before I devoted the time to a specific approach.

You know what they say: Two heads (or two hundred) is better than one.

Very Respectfully,

Div

Al Taqaddum, Iraq

i personally would
$x = GuiCtrlCreatePic("card1.bmp")
the cards and you can recognize that card by its handle
$x

Edit:

also if you need the card pics, you can open spider solitare with resource hacker and just save them all

Edited by Tomb616

Share this post


Link to post
Share on other sites

i personally would

$x = GuiCtrlCreatePic("card1.bmp")
the cards and you can recognize that card by its handle
$x

Edit:

also if you need the card pics, you can open spider solitare with resource hacker and just save them all

I've got the install file with all the card images in it, however, I'm not following your code. I need to recognize what cards are already displayed in the game window and then compare them to alll the card images to find a match. Will this code do this for me?

VR,

Div

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I've got the install file with all the card images in it, however, I'm not following your code. I need to recognize what cards are already displayed in the game window and then compare them to alll the card images to find a match. Will this code do this for me?

VR,

Div

you could always use
GuiCtrlSetState(@SW_SHOW, $card1)
where
$card1 = GuiCtrlCreatePic("card1.bmp", 40, 20, -1, -1)
to show a card, and use
GuiCtrlGetState
to see if it is shown, as like a check. Edited by Tomb616

Share this post


Link to post
Share on other sites

you could always use

GuiCtrlSetState(@SW_SHOW, $card1)
where
$card1 = GuiCtrlCreatePic("card1.bmp", 40, 20, -1, -1)
to show a card, and use
GuiCtrlGetState
to see if it is shown, as like a check.
Thanks for your help.

VR,

Div

Share this post


Link to post
Share on other sites

sure no problem

i have been creating a rpg called "Toby's Quest" about my dog Toby, and in doing so i am getting a very good understanding of the concepts used in game creation via autoit.

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