# retrieving data from a poker table

## Recommended Posts

Im not sure if anyones familiar with this feature, but a lot of online poker software has it. The best example Ive seen is from http://www.calculatem.com/ I was wondering if anyone knew how they did this? Im working on a program that should eventually be capable of playing poker online, and Id like a way to automate it by having it retrieve its own input from the table.

##### Share on other sites
By sniffing and analyzing packets. Basically, you need to reverse engineer their netwrok code (including any encryption they use, etc). If the game client can display your hand then the server had to send your computer information on the contents of that hand.

You cannot get data on the other people's hands b/c that's not sent over the network.

-me

##### Share on other sites
haha I know you cant get data on other peoples hands, not at any decent site at least, and even then youd have to hack their server. Thats a good idea tho, I never even considered going that route. That would probably be really easy to do, once I found out what port its on..

Im not sure how windows handles two applications listening on the same port however, is there something special I would have to do to be able to intercept packets without interfering?

##### Share on other sites
I tried this route, but the packets are encrypted, even though they contain nothing sensitive. It's like they guess people would try and do this. :)

Being one of those that did, the solution I went with was to inject a DLL into the app's process and read the text boxes and button states. Along with saving out the cards and scanning the screen (which is needed sometimes) I got all I needed to randomly join a table at any chair, wait for the BB, then start betting properly.

Bugger is, my AI didn't do too well. In fact it lost slighly quicker than I do for real. The main problem is that n00bz in low-stakes games don't play well enough to infer anything at all from them, nor can you fold them off a draw, and I daren't run the AI in the high-stakes room in case a bug lost me 100 bucks a minute.

Thing about low-stakes online poker is that when you're facing 8 flush-chasing n00bz, they won't fold their hands and one or two of them will make their flush every time or otherwise river rat you to death in some other spectacular way.

I also tried doing a NL ultimate mega rock AI that just bet the blind, saw the flop then only really acted when flopping a mega hand - trips or better. That lost slightly more as it's hard to disguise after a while.

After climbing the impossible mountain I was seriously pissed about how bad my program ended up.

##### Share on other sites
The idea with playing against fish at low stakes cash games is not to make them fold their draws, it's to push as much money as possible into the pot while you think you're ahead. The reasoning being that they will call with inferior hands and make decisions that are -EV, making you the winner in the long run. Sometimes they will suck out, most of the time they will not. Being called for all your money while you're a 2 to 1 favourite is a winning play against morons (who often will make those calls, or worse).

And if you're on the draw, they'll often bet too little to price you out. Another +EV situation for you.

Beating ultra-low-stakes tables is ridiculously easy if you're patient, have a sufficient bankroll and know your odds. There's no reason why you couldn't make a successful bot for those levels.

##### Share on other sites
BTW, this is highly illegal.

##### Share on other sites
Forget illegal, it's morally unconscionable.

##### Share on other sites
well Ive managed to make close to $1000 off my initial$10 off low stakes poker using a pretty simple strategy. Like Oyster stated, the fact that they make insane calls makes it very profitable for you in the long run. I could probably write a simple enough program that just followed my strategy minus all the stupid on-tilt mistakes I make. However Im going for something more complicated. Could u possibly send me some more information on what you did?

Besides the US anti-gambling laws, how is this illegal? Its not cheating, its not fraud, I dont see anything wrong with it. I emailed one of the poker sites asking them about it, but I dont see why writing your own poker client would be more illegal then using theirs.

Morally, again I dont see much wrong with it. Theres nothing wrong with writing your own poker client program is there? Is there anything wrong with writing a program that tells you the best actions based on some player stats? Then why is there anything wrong with a program that just takes the best action rather than telling it to u? Unless you think gambling is morally wrong, I dont see why writing a program to gamble for you is.

##### Share on other sites
either way, my main goal is to write a program that plays poker "well". Thinking over the consequences of using it for my own financial gain, it would probably be best not to use it on any poker sites. If I were to make a lot of money, I would be committing tax evasion, illegal gambling, and possibly a few other laws.

I do need to be able to have the program train off real games however. Although possible, I doubt the program can really fully learn to play just by playing itself. This is because playing itself would only teach it to do well against itself. Even if I have 1000 different versions all playing each other, they will still probably do better against themselves than against real players. So to fully train this program, I would need to at least let it observer real games. It would be possible to train it by just allowing it to watch me play and observe the outcomes of my actions.

##### Share on other sites
My impression was that is merely a card counting utility.

Those, unless I'm mistaken, are not illegal, but counting cards in a casino will get you thrown out simply because it breaks the odds from being in favor of casino - you're not thrown out due to some law, but are simply refused service.

Casinos live or die by that slim profit margin built into every single game.

For player vs. player, this is irrelevant. There are no artificial odds to go against, you're playing against real players. So on the other hand, you might have someone who just learned poker, or a professional, card counting gambler.

If this is playing against computer, well, poker strategies, winning tactics and chances are well documented. Unless there's a flaw in the system (RNG or something similar), then these odds will either need to even out over the long run (ultimately, it's still a game of chance), or, if a flaw does exist, the company running it will go bankrupt after being botted dry in 12 hours.

But I believe these games are multi-player, with no computer generated gameplay beyond the card dealing.

So I don't think there's any problem with this. Then again, if you made $1000, why not buy that utility, and see either how it works, or use it to make$100,000? Or a million, why be modest.

(warning: long-term winnings may be smaller than they apear )

Quote:
 This is because playing itself would only teach it to do well against itself. Even if I have 1000 different versions all playing each other, they will still probably do better against themselves than against real players. So to fully train this program, I would need to at least let it observer real games. It would be possible to train it by just allowing it to watch me play and observe the outcomes of my actions.

You'd also win the Turing award, for creating first fully rational AI.

Players adapt. No matter which algorithm you use, it would always be lagging behind, and merely follow other's strategies.

Unlike chess, the rules of the game here are vastly different, so computer AI has a huge handicap. You're still much better off with statistical aproach. At least there you have hard-coded boundary conditions. AI against real people could not only produce sub-optimal results, it would most likely expose a flaw.

##### Share on other sites
youve obviously never played online poker. First of all, theres virtually no adapting required. If you have a strategy that takes into account your opponents playing skills (which can be based on raw stats about them) you can do fine. When I play, except for my tilted game, Im basically a machine. And I make decent money doing this.

This would in no way pass the turing test. The programs only function is to play poker. True, it would probably do awful against any pro (although with a big enough neural net maybe not), but on a low limit table with a bunch of idiots, it should be able to make a lot of money. A simple learning algorithm should be more than capable of learning to play online poker. Maybe it would be limited to play at "low" stakes, but the player skill level doesnt significantly change until you get into $3-$6 limit. At 25-50 cent limit I was able to make a steady 5 dollars an hour per table.

Also, so what if players adapt? Their adaptions can be modeled by statistics about their recent playing style. If you have a program that collect stats on players, and another than uses these stats along with pure odds to find the best actions, I dont see how it wouldnt work. Given enough time to train on a diverse enough training set, it should be able to learn the game better than most humans.

Its impossible for the casino to lose money on a poker game.. they take a % of each pot. It could possibly be illegal, or morally questionable, since in a way I am taking advantage of the other players (although Im doing that normally anyway).

##### Share on other sites
and another thing, computers can do plenty of things better than humans, including many games. Why would a computer that plays poker well even come close to passing the turing test?

Also, my program will adapt also (since it uses neural nets it will even resemble human adaptation). If I allow it to train off real games, it will learn how to play against a wide variety of opponents.

##### Share on other sites
My 2 cents as a casino/poker system developer

I doubt this is illegal in a general sense however any decent poker system will have stated in their Terms & Cond that it is illegal in their poker system to use any form of bots. So if they catch you they can and probably will take all the money you made and split it up among all the players you have played with.

Bots are a very serious problem for poker networks because it destroys the trust the players have in the system. The same goes for all game bots. Be it quake, world of warcraft and the like. If a player don't trust that he will have a fair game he will move to another system.

Good poker bots are actually a lot harder to create than chess bots. The new goal in AI is to build a perfect poker bot. The reason being that everything is know in chess, all rules and the whole board. This is not true in poker. Since you can bluff and you have a number of hidden cards.

On the subject on card counting. Almost all forms of card counting is null and void in online casinos since they randomize the deck after each game played. Nothing an real casino can do. Well unless they use the fancy shuffling machines.

Then we have hacks and flaws in the system that you use to your own advantage. The solution to those problems are stated in most T&C. If you find a flaw in the software that you know is an error that gives you money and you don't report it. You can be responsible for not just damages but could even be deemed to pay to fix the problem. This thing is of course something the operators would never use except in extreme cases where the money amount lost far outweighed the PR hit the system would take.

##### Share on other sites
well actually, I never actually followed through on this but online blackjack tables only use 2 decks and allow you to sit and up to 5 seats at once. It seems like the extra information of being able to view over 11 cards might be enough to push the odds in your favor (since theyre already very close).

As for creating a poker bot, I doubt mine will be closed to perfect. However, I do expect it to pick up on certain strategies like bluffing, check raising, etc after enough training.

##### Share on other sites
If you're serious about doing a poker bot, take a look Charles Bloom's work here (he's a very talented programmer IMO).
Also check out Poker Academy and their work on poker bots.

Quote:
 My 2 cents as a casino/poker system developer

Say hi to Henrik S the next time's he's home from the Caribbean.. ;)

##### Share on other sites
As for the OP's question I did some work related to that (not for the purpose of making a bot though).
I managed to sucessfully "spy" on party poker clients, getting all the info I needed.
First try, I captured the image X times a second and did image analysis to get the information that I needed (I also read the chat window control).
This worked very well but required the window to be fullt visible (since windows doesn't "draw" things that is behind other windows).
Then I discovered hand history files!
This is basicly a log of all action on the table and I was mighty suprised to find out that the log was saved in real time (this is the simplest way of doing it I guess).
So for my second attempt I sucessfully parsed the real time log file.

The aim of the exercise was to create a program that displayed a live poker game in 3D, in real time.
We had a customer that does internet and TV broadcasts from some of their high stake tables.
In the end they didn't had the energy to go through with the project and stuck with their 2d client.
In this buisness people are making to much money to make an effort...
"why change anything while you're still making a lot of money out of it?"

##### Share on other sites
If you get caught using a bot on a poker site that doesnt explicitely allow them, they will not take your money and split it up with the people you played against.

They will take your money and simply keep it for themselves. This is compelled by logic on their part as it is against their best interest to admit that they have a bot problem.

...

As far as having so many network inputs.. thats just crazy.. find a way to generalize.

Personally I would go for standard actor/critic machine learning with exploration.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628278
• Total Posts
2981785

• 10
• 11
• 17
• 13
• 9