PDA

View Full Version : Reading Data From the Screen


Big_Jim
10-07-2005, 04:41 PM
(x-posted in Software)

I am attempting to write a program to do various calculations based on a particular hand in real-time.

I am currently working with PartyPoker and clones.

I have been able to read from the chat box all the information about any bets/raises/calls/etc as well as the information about the community cards.

However, I would like to be able to read the cards themselves, primarily to figure out the player's hole cards, and opponents cards if/when they are shown.

I have found a decent Screen OCR library (Textract. Google for it), but I cannot figure out how to read in the cards.

I think that I may be able to do it by creating a font which matches the PartyPoker font, but I have thus far been unsuccessful.

Any suggestions?

If you have suggestions that you feel to be too technical for explanation here, PM me.

Edit: I'm using C++ with Visual Studio 2003

Link774
10-07-2005, 04:55 PM
I've programmed a bit but not well enough to know exactly how to do this. I'm thinking once you have a picture of the screen, since you know the (x,y) coordinates that each position's cards are at, you can just do a pixel by pixel comparison to figure out the index and suit. Would that be too inefficient? I think using OCR would be tricky.

Freakin
10-07-2005, 05:41 PM
all the information you need should be written out in the hand history file in realtime

Link774
10-07-2005, 05:45 PM
Heh, that's a bit easier! Good point.

Big_Jim
10-07-2005, 05:59 PM
Figured it out, thanks.

10-08-2005, 03:36 AM
[ QUOTE ]
I've programmed a bit but not well enough to know exactly how to do this. I'm thinking once you have a picture of the screen, since you know the (x,y) coordinates that each position's cards are at, you can just do a pixel by pixel comparison to figure out the index and suit. Would that be too inefficient? I think using OCR would be tricky.

[/ QUOTE ]
You, sir, are an idiot

MODS - Why aren't threads like this locked as soon as found?

MyMindIsGoing
10-08-2005, 04:03 AM
[ QUOTE ]
[ QUOTE ]
I've programmed a bit but not well enough to know exactly how to do this. I'm thinking once you have a picture of the screen, since you know the (x,y) coordinates that each position's cards are at, you can just do a pixel by pixel comparison to figure out the index and suit. Would that be too inefficient? I think using OCR would be tricky.

[/ QUOTE ]
You, sir, are an idiot

MODS - Why aren't threads like this locked as soon as found?

[/ QUOTE ]

WTF, I have not seen a single thread locked in this forum. This one is far from locking as far as I am concerned. Just let them have their little conversation...

TheTROLL
10-08-2005, 04:18 AM
You want every thread locked where someone says something stupid? Good luck with that....

10-08-2005, 05:12 AM
When they're discussing methods for writing programs to cheat at poker and/or violate the terms of service of various sites, yes.

Nothing to do with stupid content.

MyMindIsGoing
10-08-2005, 07:18 AM
[ QUOTE ]
When they're discussing methods for writing programs to cheat at poker and/or violate the terms of service of various sites, yes.

Nothing to do with stupid content.

[/ QUOTE ]

Lets put a stop to anything any person does not like in the world. What an utopia it would be!

The only post with stupid content is yours.

10-08-2005, 07:43 AM
[ QUOTE ]
Lets put a stop to anything any person does not like in the world. What an utopia it would be!

[/ QUOTE ]

So if someone wrote a post asking 'Where do I find a bot to play poker for me?' and someone posted a link and instructions to do so, you'd have no problem with that?

[ QUOTE ]
The only post with stupid content is yours.

[/ QUOTE ]
I never implied that any post had stupid content. Learn to read.

MyMindIsGoing
10-08-2005, 08:03 AM
"So if someone wrote a post asking 'Where do I find a bot to play poker for me?' and someone posted a link and instructions to do so, you'd have no problem with that?"

A question like that does not belong on this forum for starters, and no I would not have a problem with that. I am not afraid of those bots.

"I never implied that any post had stupid content. Learn to read."

I did not write that either. Learn to read. Now leave it to the OPs to continue what they started and piss off.

10-08-2005, 10:52 AM
[ QUOTE ]
Now leave it to the OPs to continue what they started and piss off.

[/ QUOTE ]
The OPs have finished what they started as far as I can tell. And I wasn't aware this was your forum. You were the one who replied (twice) to my reply to someone else

[ QUOTE ]
and no I would not have a problem with that. I am not afraid of those bots.

[/ QUOTE ]
Neither am I. That's completely beside the point.

MyMindIsGoing
10-08-2005, 11:24 AM
Am I not allowed to reply to you? Are you some kind of royalty?

Link774
10-08-2005, 01:19 PM
I'm an idiot for suggesting an algorithm to see what cards are on your screen? As long as you're not using that information to gain an unfair advantage, screen scraping is allowed by Party ( Party's Policy on "unfair advantage" Programs (http://www.partypoker.com/about_us/unfair_advantage_policy.html)). As Freakin pointed out, this information is also available in real-time in HH files. These are scanned by software like PokerTracker and PokerAce which are also permitted my Party's TOS. Sounds like OP just wanted to do some odds calculations or something which seems perfectly reasonable. As long as you're not colluding, creating a bot, or creating a huge shared stat database you should be OK.

10-08-2005, 01:52 PM
Apologies for calling you an idiot. Even though the solution is obvious and he probably would have found it, I couldn't believe someone actually told him.

In his own words, he's using the screen scrape so he can perform real time calculations (we don't know what for). The most innocent implementation would be for real time odds calculation or an auto folder, and Party has sent violation notices before for these. Although they're not specifically mentioned in your link, they're definitely on the borderline. More insidious applications could share automated hole card information to third parties who are colluding (as happened with Winholdem), automatically remember, calculate and display outs in games like 7 card stud (a huge, unfair advantage), or be used as nutpeddling bot at smaller stakes.

Programs like these have the capacity to kill online poker, and everything that can be done to discourage them should be. Widespread knowledge of these will scare away new players, and give lawmakers stronger arguments and incentives for banning online poker.

I play NL (as does OP) so bots aren't really a problem for me personally in terms of getting outplayed, but I think we should discourage discussion of them and systems for implementing them. Note that the problem here isn't necessarily OP, but people who might read this thread or ones like it and get ideas on how to actually build them. The less information for people to develop and spread applications like Winholdem, the better.