The Open-Sourcing of Poker and Poker Bots

Tuesday, June 02, 2009

Online poker botting is hard work. Trust me.

Whether you're using a third-party poker bot or implementing one from scratch: be prepared to invest a lot of time. Depending on your needs, creating a mature poker bot can take anywhere from several months (in the simplest possible scenario) to a year or more. You've got to:

  • Get the Input/Output mechanisms working smoothly.
  • Produce an effective Poker A.I.
  • Choose a stealthing mechanism.
  • Set up the poker botting hardware and environment.
  • Leverage rakeback and promotions.
  • Handle various other meta-botting aspects.

That's a mountain of work, and unless you're dedicated and have a lot of time, you'll probably fail (however, you'll still have all that hard-won programming and poker knowledge, which is valuable in its own right). I've written three or four bots and only one was successful, and it was built with the advantage of a) a backer and b) ample time and c) obsession.

And I have to wonder: what if we made poker botting a lot easier and more accessible?

I'm not talking about some hackneyed, get-rich-quick pipe dream. Online poker isn't a simple gambling game like slots or roulette, where all you have to do is calculate the odds; winning poker "systems" are a myth. We just want to clear out some of that ever-so-tedious boilerplate which is the primary barrier to entry for any newcomer to the field and a continual thorn in the side of any old-timer.

One solution?

Open-source every aspect of poker botting and automation, from the input/output components for various sites, to the stealthing mechanisms, to the user interface, to the A.I. framework. As per the famous line from Jaws:

The head, the tail, the whole damn thing.

Imagine a 100% free open-source poker botting codebase featuring:

  • Pluggable rulesets for each poker variant and betting type: Hold'em, Omaha, 7-Card Stud, etc.
  • Pluggable input and ouput components for various online poker sites, utilizing your choice of screen-scraping, function detouring, binary code analysis, and/or OCR.
  • Extensible poker A.I. framework flexible enough to be used at any poker site, in conjunction with any poker variant for which you have a ruleset (see pluggable rulesets, above).
  • Pluggable poker A.I. and strategy modules covering everything from multiway equity calculation to tourney ICM to rules-based starting hand analysis to neural nets and genetic algorithms.
  • Scriptable AI allowing any aspect of the poker AI (the framework or the pluggable modules) to be scripted against.
  • Pluggable stealth modules which can be snapped in at the user's discretion to provide different levels/modes of stealth.
  • Pluggable integration with third-party tools such as PokerTracker, Hold'em Manager, and Sharkscope.

The idea being that whoever you are and whatever you're trying to build, most of the tedious low-level grunt work and boilerplate has already been done for you. Now you can focus on the juicy parts. Now you can embroider, streamline, and customize.

  • Not a programmer or don't have the time? No problem. Download a full-fledged, ready-to-go bot with a starter AI.
  • Expert poker programmer? Build your own modules and plugins and leverage existing ones in whatever combination you choose.
  • Wanting to build a real-time strategy tool rather than a bot? The codebase has everything you need for that, too.
  • Want to build a commercial bot or tool? Use the codebase as your starting point; develop proprietary value-added additions around it.
  • Interested in a pure poker game, without the botting? Leverage the AI framework and components as your starting point.
  • Is data mining your thing? Pluggable input and output components, w00t!

This isn't just idle wishing/navel gazing. We can actually make this happen. Heck, I have in my possession right now a generic extensible poker framework handling multiple sites, multiple games, multiple tables, multiple AI modules. It's pluggable to the Nth degree. And I'm just one guy. There's also the OpenHoldem project. There's Pokersource. Our friends over at have scads of code. Not to mention the 2+2 software forums. Many others not mentioned here. And perhaps most importantly: you. All of the poker-programming hobbyists operating under the radar, whose work has yet to be publicized. (And trust me: there are more of these guys than you think, as my inbox will attest.)

But more to the point: it doesn't take a thousand programmers; it takes ten, or twenty, or thirty. Every decent open-source project features a small core group of developers supported by a larger satellite group of occasional contributors. I'm not sure how much poker-related code has been written to date (tons, approximately), and I don't know that every poker programmer out there will welcome an en masse shift to open source...

But I do know that the following ingredients...

  • The power of open-source software
  • The tenacity and creativity of dedicated poker botters/programmers
  • The potential for real-money profits

...can be explosive in their combination.

So how about it?

Is a universal open-source poker botting codebase feasible? Why or why not? Would you contribute to such a codebase? Would you use the code? Love it? Hate it? Leave a comment and let us know.

Tags: poker bot, open-source, online poker, poker

86 comment(s)

I've worked with both WinHold'em and OpenHold'em at different points. I've also worked on my own proprietary bot, although retrieving table state from the poker client is like pulling teeth. OpenHold'em already has some of these features, but it's particular to Holdem and the code is not as clean as I'd like. But there's some valuable work there.

I'd be extremely interested in helping create a universal repository, or at least, using it. It really depends on how capable it is and how much work it saves.

This is the way the world is going the only question is when.

Addendum, a lot would depend on whether you were able to convince for ex. the Pokersource guys to contribute their code. Or possibly that code is already licensed in such a way that it could be done with their blessing. Either way, if the four or five top poker-coding sites get together, this becomes not just plausible but almost easy. The code is there.

And so the end (of online poker) begins...

@OSFTW: Hopefully just the beginning of online bot poker!

I would use and contribute to such a project. Preferably on the AI side, although who would actually want to write all the screen scraping/stealthing code?

First I need to say: epic pic of the Richter book. That thing is battered to hell.

As for blowing the lid off the industry with open source, great idea. +1. Already happening in certain spots as you pointed. What's needed is a starter codebase that has enough functionality to draw in users and contributors. Critical mass is key.

Most open-source can be repackaged as part of another open-source project. There's nothing really stopping you or anybody from taking OpenHoldem + the Pokersource stuff + anything else and building it into a single proj...I'm not familiar with the licensing but most open-source licenses allow this.

Have you considered CSPoker?

We're certainly not a mature project yet, but we have a botting framework and some pretty advanced game tree search bots. The bots are mostly for AI research purposes. We welcome any contributer. All source code is GPLv2+.

i met you at a pt3 talk you gave out in vegas last year. i asked you if there were any free hand history analyzers out there and you said 'none that are any good'. then we got to talking about how ripe poker is for open source. so i can roll with this idea, but not when it comes to poker bots. maybe theyre harmless but nobody wants a flood of bots either. that would hurt the game i think. plus poker's already been getting heat on the political side. so my vote is for NO.

I can see your enthusiasm and I myself share it to an extent, however, it shouldn't be made this easy, any person with zero technical knowledge could "leverage" this framework and then it would just get over used. I would prefer if everything was kept low down, half the fun and challenge of coding a poker bot is all the little tricky bits!

I myself have read your previous articles, and as interesting as the code was, I still wanted to try doing it my way - even if it was in a different language (Delphi) - just because it provided a challenge.

This shouldn't be open to abuse so easily from people without the drive to learn.

Sure, you can certainly achieve. I really would like to see it happen. Yes, I am willing to contribute to the project, I am a professional software developer (C++) and working in the industry. I will certainly use the generated code, and will probably both love it and hate it.

I'm in. I'm a C/C++ developer (Windows apps, mostly) with 30 years programming experience.

email me: lrhamelin (at) gmail (dot) com

I'd love to see this happen, I think poker clients have somewhat stagnated and encouraging the companies to put programmers on client development is a good idea. I notice that a number of people are saying that they would like to work in AI which is the same situation I am in. I literally have no experience with data extraction or stealthing, and haven't had the time to learn recently, but am now in a situation where I was considering starting a poker program as a side project. If there was a collaborative effort being started, I would certainly be interested in getting involved.

I love the idea! My two cents:

  1. Keep it modular. Put a clean and simple interface between each of the components so that if you only want to use the input/output or only want to use the AI you can do so easily.

  2. Plan for interoperability. The core system would be built using one language, but it would be ideal to be able to work with the library using C/C++, Java, or .NET (C#, IronPython, etc). A simple wrapper or COM interface would work, or you could set it up as a client/server system with some sort of service based architecture (SOAP, REST, etc)

The major problem I see in doing this is giving the poker sites an easy way to detect, by virtue of having a common engine to scrape their data.

I love the idea, but I think maybe the implementation will be difficult...because lets face it - the poker rooms are not our friends. They'd LIKE to be our friends, they want to be our friends, but THEIR friends (the bulk of players) don't like us. The money we'd bring in is tiny compared to the money the bulk of anti-bot players bring in, so the rooms make a +EV decision and decide they CAN'T like us. It's not personal. Just....+EV.

That said, they have programmers. Those programmers may or may not have a clue, but chances are, they can explain well enough what a piece of source code does to a security specialist, and that specialist can extract PATTERNS. Patterns beyond your control are whats going to be difficult. Stealth really doesn't matter much. If after a patch, 500 people stop playing poker all together until an update is issued to your project, and 40 guys go from playing 15 tables at a time to 1, that's a significant event. Enough events like that (hell, maybe even only one), and it makes a pattern that simply screams BOTTER. The banhammer will be thrown. Guy goes from weak-tight to an identifiable aggressive-tight playstyle in the course of a single day, and bumps up his tables from a consistant 1, to 5 or 6...well, stealth plugins don't matter much. Banhammer. Hell, with source out there, they may not even need to look at meta-patterns. You can inject code into other processes at will, sift through that processes memory. Whats to stop our oh-so-hated Poker Stars from injecting, hashing a few sections of every processes memory, and analyzing it? With source and executables of the target app and libraries, i think it'd certainly be trivial for you to implement.

Is this a +EV raise? Is the return worth the Jupiter size time investment, the hand holding, The constant patching and rewriting code? The tears of fools? The tears of small-time utility/bot writers who are now out of luck because the war has taken things over their head? If it is, I'd love to have it pointed out to me, because I'm totally missing it. I can easily see a project like this bringing "Evil Botting" to the forefront of every poker player, and every online poker room's board of directors, mind. Even the guys who don't really give a shit about botting/automation/utilities RIGHT NOW (like AP) will have to make a decision, and that decision is not going to be in our favor.

would love to help .. dev with adv c# knowledge pillath at gmail dot com

playing poker myself btw nl100sh

I think it's a very good idea and I don't see why it wouldn't be feasible. Some people actually say "this is the end of online poker..." I really don't think so. When realtime odds calculator appeared, many people said the same kind of mistake.

We really have to be objective: - odds calculation is not cheating, it just helps you when you are a beginner, or when you play on multi-table. Some poker pros now recommend beginners to use realtime odds calculator in order to improve their game faster. - clicking automatically on a button is not cheating.

So, take an odds calculator and add an automatic clicking system... logically, it is not a cheat.

You will never be able to see the other players cards, and you will never be able to predict the future. It just replaces the human brain(s), thanks to the human brain(s) who made it. If you are a bad poker player but a good programmer, you'll get a bad pokerbot. If you are a good poker player, but not a good programmer, you'll get a bad pokerbot. You really have to know how to play good poker and master a programming language in order to make an efficient pokerbot. That's exactly why James' tutorials interest me A LOT!

An open-source project will allow people to work on a very interesting project, improving their knowledge of poker at the same time.

It's a good idea James, the fact to divide the pokerbot in some modules/plugins: - it's the better way to learn things step by step - it's easier to develop, debug, improve the code - and it lets people have the choice between the blocks that will compose their pokerbot.

So, when do we start? :)

PoWaZ - It's totally workable. Really, it is. It would get a TON of people botting, especially if there was an even marginal starter AI module.

I'm questioning the wisdom of such a move, however. I love the poker botting series on this site, because it FORCES people to think, if they want to write a bot (rather, write their OWN bot). The benefits of this are, you end up with 5000 different bots, written by 5000 different people. That's a lot of bots! Almost certainly far too many for any site to bother to keep up with, and certainly not anything threatening enough to warrant too much action.

Now take those 5000 people, writing 5000 bots, using the same framework, the same basic methods of hooking into the client. Now you have 1 basic fingerprint 5000 times, and THAT is a bad idea. If the same basic method of hooking into a particular client is the same as say, I use for my hand calculator....well, the site is gonna nuke it because THAT IS WHAT THEIR PLAYER BASE WANTS. The player base doesn't care for well crafted arguments, for logic, or reason. They want to play against people, and that's that. When the sites nuke this same method -I- use, well, I'm shit outta luck, cause just getting this calc up and running took all of my meager skill.

For all the small time botters, tool writers, and what not, this project could very well mean the death of our own personal projects. Some of us use these tools to make money - and risking other peoples money should NEVER be done lightly.

I'm not saying don't do it. I am saying - consider carefully before you act. I'm actually begging for it, because the impact of this could be (for a community this small) tremendous.

Very interesting post, this blog gets better and better

Im working with openholdem right now. Its very good to be open source, however there are some flaws on the design of the application, maybe because it is completely based on winholdem and they wanted to make it compatible. It should be more modular.

And the main problem is the stealth mechanism there should be a better way to do this. ie: a TCP/IP based app that controls everything from the botting machine, or even better, make a configuration file like number of tables, levels, etc. and use a single machine for botting, the app should be invisible at process and gui level so it is not detectable. It takes me about half hour to open 4 tables and connect them to OH, and sure, I could write an autoit script that could automate all the stuff on both machines poker client and oh.

I thing that you could start a "super" bot project taking the best of all the worlds.

Im not a c++ developer, Im a c# developer, but I could contribute throwing the dart to the dartboard hoping that it lands on BEEER! hahah.

No seriously, you should start the project on google code, or sourceforge, or any repository and see what happens, Im sure that you will get a lot of contributors

Regarding the concern someone raised about the sites being able to identify a bot by having access to the source code: this is avoidable.

They try to detect by binary file name...we add an install step to randomize all file names.

They try to detect by registry key...we don't use the Registry.

They try to detect by checksumming/fingerprinting binary files...we add an install step to append a meaningless random payload to the end of each binary file.

They try to detect by observing whether mouse clicks are authentic or simulated...we create a DDK mouse driver.

They try to detect by detecting the presence of injected DLLs...we rootkit our DLL, or embed inside an innocuous DLL such as Yahoo Messenger DLL.

They do anything we can't countermeasure...we move the bot to a separate machine and play over terminal server.

My point is, given a group of developers, the run-time characteristics of the poker bot can be manipulated randomly on a per-user basis. I believe this can be done with effectively 0% chance of detection.

In response to one of the above comments

[quote]I think poker clients have somewhat stagnated and encouraging the companies to put programmers on client development is a good idea

Sites may be loath to change things given that poker players are whiners and with every little client update they (the sites) probably get a bunch of complaints from them (the players) so innovation maybe runs into some sort of user attrition thing and doesn't improve the bottom line plus the only real innovation you can do at this point is to go to a 3D interface which has already been done and most players don't like it.

Another piece of open source is the freepokerdb hand history analyzer.

There's a 2+2 thread on it in the SW forum.

For that matter, here are all the open-source "poker" listings on SourceForge:

Nice one James, I agree one hundred percent but for very different reasons. I think such projects will cause the main poker sites to lose business and that can only be a good thing. They are too powerful and are not interested in players at all except in so far as how much money they can extract. In the end poker is gambling and most people are losers so the eventual demise of these sites can only be a social good (can you tell I'm European). For myself, the only interest poker has is the intellectual challenge of developing good AI and the bad-boy thrill of picking the poker client app locks. I also like playing poker with friends around a table but always for modest stakes just to keep it interesting. I work (but not for long more) for one of the major poker companies and I can tell you they have very little interest in anything except the money. Be careful, these bastards will notice you soon enough and you are potentially capable of reducing their very lucrative income stream (millions per week).

Far fewer millions per week nowadays - I think daubing Stars and the other creditable poker houses with the same brush as Tilt was obviously an error. You were certainly correct about them not being interested in the players though.

Do it. It will be open season on poker botting if this is done properly. I don't know what a massive influx of easy to use bots (free bots, at that) would do to the online poker industry, but in my experience it's unwise to bet against open source.

Open source all of it, and it's about time.

I am very interested in such a project, however I am still weary of the impact in this goes main stream. I have done some AI research in the past and I am interested in trying to apply it to poker.

I sure would like to be part of that project ;)

i think it will be wrong de?ision. as far as i can understand, where are some more or less ready poker bots more or less successfully working now. and poker sites somehow defending against bots. if such uber-bot will be created, everyone will use it. everyone, who working with bots now and even more people, who just wanting to try botting. so, poker sites will need to defend against only one bot, which will be far more easily when now.

and poker clients have one huge advantage - license agreement. shure, it will be changed so, what any unsusual activity at client pc will lead to account block.

My opinion:

"open source" and "poker bot" sound rare together. "poker bot" is not a general purpose application that many people would like to use. Second, there are not commercial "poker bots" to compete with.

And, finally, out-of-the-box poker bot will be, presumibly, so weak that only real experts (on AI and Poker) will be able to make it win. So instead of "out-of-the-box poker bot" we will develop a "poker framework for online unattended playing"

In any case, I'll follow this idea evolution

When we put all our eggs in one basket like that the poker sites will learn to pick on it.

On the up side - since it's open source, we can modify it... An arms race will ensue.

I would definitely use and contribute. Even if it wasn't used in commercial poker rooms, I think the AI component would be interesting to work on. I vote we start our own poker host as a sandbox for bots to compete and improve. Would give developers a legitimate front for the whole thing as well as inspiring innovation through competition.

I think you just spent way more time talking about open sourcing a framework than it would have taken to put your own code up on SourceForge, Google Code, etc. Put your money where your mouth is. =P

Andrew that's a great idea. An academic poker sandbox to test out various AIs. Lofty and noble. Draw people in from both sides. And of course those AIs just happen to be "snap-in" or "plugin" compatible with the bot framework. Mum's the word.

Isabella -- There are commercial bots: WinHold'em, ICMBot, just to name a couple. An open-source bot could compete with those, but mostly I think it would appeal to a different audience. The key is to leverage the community to produce a stable, easy to use bot. The key is to create mass appeal through ease of use.

If poker botting weren't so damn messy, the number of botters would explode. 90% of people who'd enjoy botting never give it a try. And 90% of the people who try, fail. This project would open the door. A ten-times increase in the botter population wouldn't surprise me, if this goes to press.

We'll see...

I for one would be interested in the project, but like Andrew stated above, I think having an isolated test environment is a must. My preference would be a hosted environment where we could openly compete bot vs. bot, but I would settle for a client interface we could plug into similar to PokerAcademy.

Its a double edged sword. I love the idea and have spent hours working on various parts of the code base for my bot, so if you could get them already done, why re-invent the wheel?! Obviously my fear is, if it is public, if they are smart the poker rooms would be watching the site, looking at making code signatures against the code base available so that they could tell who is botting and ban those players at will; probably at the point you start making a +EV.

My suggestion is that we build our own poker client were we would could play amongst ourselves. The fact that the codebase that we develop could be leveraged against other sites is something we could then deny: "Really! you can do that with it, I didn't realize!" Obviously this would have to be a really good client which we could open to any player who maybe reckons they could beat bots; and 'real' as in 'real' money play. As a side note, imagine how secure we could make it. We could then use the profit to pay for the site. One possibility is that if your code is good, we would have a review board, we could give the contributor a bonus.

Ultimately I have used this as a learning tool and I have been through so much to get as far as I have, c++, c#, .net, interop, detours (getting that working was hell), rootkits and now I am just working on creating some A.I. based on genetic algorithms. So I am a little reluctant to have it all simply there; but then again I have only got as far as I have because I have had your code to reference.

Go for it James, i'm in.

So I like the idea, yes I would take part, and why not?! There is so much intelligence in the world, why not come together on this, such a cool project, lets see what we can really do.


It would be an explosion of botters, but the overwhelming majority of them would never be able to come up with a winning AI - and people with a winning AI don't have much of an incentive to sell it at a price others would be willing to pay - so I don't think that we would end up with more botters than the 'ecosystem' can support. However, someone above made the very salient point about what happens when the poker rooms update the client and a whole slew of accounts go from multi-tabling 10 hours a day to playing one or two tables for a couple of hours. That's just asking to have your bankroll confiscated. Perhaps a better way to do it is to open-source the techniques (injection, stealthing, message protocols etc., which James is already doing, albeit at a slower pace than I would like :-P) and individual botters can implement them any way they see fit. This has the advantage of creating an implicit barrier to entry, where only dedicated botters benefit from it. The only upside from making a turn-key poker bot is that a lot of people who lack the skills will try it for a short time and donate their money to good players and good botters. Is that really worth the extra scrutiny it will engender from the poker rooms?

I definitely think this is feasible and I would be happy to contribute to such a project! :)

Would be account suicide on anything but free games/free sites.

Get an F'ing clue. Bots are pretty much outlawed on every site. Although in fact bad bots make plenty of money for the sites. But they can't publicly admit they don't care, and must make the average paying customer happy.

A real world example is the OpenHoldem bot. Full Tilt almost immediately but pretty detailed detection in the client to catch it specificly. And historically PartyPoker right away added simple, then more elaborate detections when WinHoldem came out..

Looks like the anti-botting shills are out in force, eh? (cough cough H STERN cough cough).

Truth: The sites would have the utmost difficulty detecting a bot with pluggable stealth. Fact is, there are umpteen jillion ways of stealthing an application. When you allow a piece of software to use any combination of those on a per-user basis, and especially when you can ALWAYS, NO MATTER WHAT, simply stick the bot on another machine and connect via Terminal Server gets extremely difficult if not impossible to detect a bot.

Consider malware. Viruses, adware, trojans. These have been driving operating system updates for years. The vast majority of malware goes undetected. Even the well-known ones (Conflicker) go mostly undetected. Fact is, the Windows operating system is a haystack. And the bot is a needle in a haystack. Even if you open-source the bot, even if the site developers have access to the source code: they can't detect it on an arbitrary end-user system at runtime. Can't. Won't. Shouldn't.

An application exposes various fingerprints whereby it can be detected. These fingerprints can all be modified/changed on a per-user basis. That means the bot that User A is running has a completely different set of fingerprints than the bot User B is running. Both bots were born from the same codebase, but Bot A is using advanced rootkitting, Bot B is running on another machine. Both bots binary files are completely different at the binary level, due to arbitrary payloading. A bot can run in any process on the machine. It can be attached to any single binary. It can run in user mode or kernel mode. It can run sometimes and not others. And it's binary files can be tweaked on a per-user basis so that simplistic CRC checks don't work. And all this can be done automatically.

I vote NO - mostly because I took the time the past several months to make a functioning poker bot for FTP. It was a pain in the arse to create and that makes it 100 times more enjoyable. Give newbies a Poker Bot and they'll just get us banned faster.

@Jerry UNLV:

Rather than client-side innovation, I was considering more innovation to the tech behind the scenes (which I have on reasonable authority doesn't get much attention) and advances that can be made to both the social and game aspects of poker. Poker is poker, but before online poker I had never heard of huge MTTs being played on a regular basis. Maybe this is just because of where I am from, but the largest tournament I know of on a regular basis was about 100 people. Other than this, how has online poker really changed the way the game is played?

I would like to see an online poker company use their wealth of hand history and usage models to provide a more pleasant experience for players, but all I see is the same drab table of games with a few rough filters. I'm not going to pretend that I know what they should do with this data, but I'm sure for all the money they make they can think of something to set them apart from the competition.

@Anonymous above:

Making an open-source poker bot doesn't detract from your accomplishments in anyway. Not only do you have something which works now, rather than something which may or may not work in the future, you have the experience that you can (if you wanted to) take the framework and plug in the stealth and AI you have written for your own bot, or use your own stealth with someone else's AI. Open sourcing a framework doesn't force you to open your code, or even discuss it with anyone, but does give you more flexibility for the use of your code. I can only see this as a good thing.

I'd vote against it. Dont get me wrong i am a firm beleiver in open source, I have released a few projects over the years and contribute on a few more when I get the time.

A poker bot - I beleive it is something that shouldnt be given to the masses.

I dont want to sound selfish, but I spent a lot of time and effort on creating a half way decent bot, and because it is something that is against the rules, border-line illegal, it isnt something that should be given to everyone who knows how to open up internet explorer. Not wanting to sound like an elitist jerk, but if someone doesnt have the knowledge/will/time/energy to put something together, then too bad, they dont get to play with it.

James - I love what you have done with the site, I really do, you have given people ideas, and some great tips on how to get started and how to progress, you've inspired people to have a go at building something, which I love. But to create one and release it to the general public is, imo, bad.

The market will become saturated with them, games will start to die until you get to the point of having 10 bots at a table, and then everyone loses.

You can't stop it; if it doesn't happen here it'll happen somewhere else sometime later. That's just the internet.

Poker bots are like players. Most will lose money; very few will make money - and those will be due to the skill, patience, determination and resources of those who make (procure) them. Personally I'm not bothered if there are loads of crap poker bots in a game. If you play enough you'll naturally adapt your game to beat them. If you can't you'll stop playing and try something else, or playing more live games.

I'm not going to be able to make a winning poker bot, but I've enjoyed trying and will keep trying. The techniques I've picked up here have been really useful in understanding software engineering, windows, program construction and general hacking.


I agree wholeheartedly with JB above. In the 3rd part of this series ( James discusses the benefits of creating a poker bot. Undertaking such a "pet project" would force poker players to be better coders and coders to be better poker players. Like many others, when I read that section all I was thinking was "blah blah blah show me the money." But having now created a poker bot I have a different point of view. First off, I did learn a ton and am thankful for it. I was mostly just a VB programmer beforehand but now have a full understanding of C++, memory management, OOP, creating program frameworks, etc. Secondly, I've succeeded. Even if my bot doesn't make money I undertook a huge project and now have a functioning end product. This personal fulfillment would never be felt by someone who simply downloads the entire project. And thirdly, you don't deserve it. I say "you" because I'm guessing the majority of readers here are waiting (possibly as long as 10 months) for James to dump the code on them. I wouldn't expect someone who works on old cars to give me their classic Corvette when they've finished. I wouldn't deserve it either.

So I vote NO to Open-Sourcing. The only benefit is that since this project really is too big for a single person, open-sourcing should create the most comprehensive Bot possible. However, to then give this out to anyone would be a waste. Rather, a team of several (2-20?) programmers who have Bot-writing experience should get together. They've already proven they have the will and energy for such an undertaking.

Hello how can i contact you via email , do you offer project development/coding ?

please get in touch with me my email provided below


NO. It will ruin the fun of those playing for fun. It will ruin the years of skill of those skilled poker players who have played poker for years and investe a lot of time learning it. I will ruin the botters who are there to make money. It will ruin online poker. It will bring noobs and asses en masse to the poker tables. It will rule one of the main purposes of poker botting, THE PLEASURE OF CODING IT. If you want to contribute in an interesting way to the poker botting scene (and poker in general) just make a wiki with lots of info about poker, like hand analyse etc. Don't ruin the fun

Do it, mofukkas.

I think the notion is, it will make humans better. There is no unexploitable strategy in poker, humans ought to be better.

Humans will never be better than a well built machine. Equal at best, but not better. Of course botting hasn't reached that level yet, but opensourcing it would be a giant step towards that. Eventually it would ruin online poker. Just make a poker room just for bots, with an easy API to use. And open a forum for that so that people can exchange ideas but with levels like pokerai. Don't make it so that every single braindead guy can do it. If you have played online gaming like CS or MOHAA you know the only outcome of public hacks is ruin.

Anyone know what happened to the openpoker code from wagerlabs?

I read an interesting comment from Howard Lederer who used to be a world champion level backgammon player. As he put it, once software was able to beat the best players the online sport died. He predicts the same for online poker.

This is the coolest site I have ever visited. I am learning to be a better poker player by learning about bots. Coming from the "security testing" world I love what you are doing. It reminds me of the old days when Danny released SATAN, one of the first automated tools for security testing. The doomsayers predicted the end of the world. In a way they were correct.

Good luck.

Some aspects of the coding could be made open source but not all of them. One year minimum just to get it running. Remember the guys from University of Alberta have been doing that for nearly one year.

As @aesbreaker said "They do anything we can't countermeasure...we move the bot to a separate machine and play over terminal server.", I think the only safely way to do a bot is that: make the bot run into another machine (it doesn't matter if its real or virtualized computer) and make the interaction with poker software via sockets or anything like terminal server.

How about onto a usb key?

Hi James,

I am actually putting together a team of programmers for this botting project. Because I got lots of advanced ideas.

Now, if we would keep it a closed project between, let's say, 3 to 30 programmers ALL contributing useful stuff on a continuas basis... I am definitely open to "borrow" my resources for such a project. Even some of the really evil and extremely valuable stuff I'm working on, personally.

But it needs to be done in a controlled environment. And not too many should be involved. Max 30... maybe a bit more.

I got some ideas on how I envision this. And I wouldn't mind setting it all up in such a way that we can have this controlled environment protecting our source code. So the code all these programmers would share with one and other is protected but still open source for those who are involved... and help improve upon.

So my ideas based on what you said:

  • Do this in a controlled environment with a small group of dedicated programmers only. (or programmers who even put together teams of programmers, just to make this happen like myself)
  • Create "rules" for this group
  • In this way ideas can be shared within this environment too. To be able to do this, it would be good that each programmer in the group has a different skillset that sets them apart from one another.
  • etc.

I would expand on this. But I will not since I do want to keep some things for myself in this case. But it's for sure that this idea has lots of potential... if it's done and performed properly. And it gave my mind food for thought. As you can see above.

Now, I will send you an email James. And we could discuss this idea further per email, if you'd like.

I'm looking forward to talking more personally with you about this.



PS. In case you get TONS of emails... I entered my personal email in the "optional field". You can contact me there so that we can get in touch.

I would like to contribute but I have a bad habit to ask people for stuff and keep it all for myself after. So if someone wants to give me some poker hands and/or efficient source code, you're sure no one will benefit it but me.

Thanks in advance :)

Another fellow talking about his poker botting experience at

Don't you guys think that PokerStars wouldn't already have built some sort of internal poker bot used to stimulate the community, harvest the users and manipulate the odds? (must be so easy for them to do!)

I wouldn't be surprised if 50% of the entire players on PokerStars would be bots with different level of AI (if any). Just like evil websites such as uses bots to maintain the cash flow up and running.

I cannot wait for the day where we will see a publicly annouced heads-up match using one or more poker bots, just like Casparov vs Deep Blue. Should be fun to watch.... Left aside the tons of cash to be won, the sponsors to be earned, and the AI advancements acknoledgements. A very lucrative business that is... (just like the 10M$ X-Prize won by Virgin for their space flight

For all the users complaining about this blog and its tons of intelligible information, get a grip! You are probably playing (insiders) bots every time you are going online anyways... It comes with the game, and it is up to you to outsmart them! (if you can, but thats another story...)

I've been coding for 5 years in C++ and I'd sure be part of this if there would be some sort of ROI program, because after all, the benefits need to go somewhere :-) So for that, I doubt the OpenSource project will work, but it will rather be an obscur circle of wise-guys with one powerful money-driven boss that has some money to spare...

You can always count me in! But I honestly doubt an open project with come to life... (I would definitively see this kind project spread out and take over tournaments with virus-like intercommunicating zombie computers all over the world)

Why not?

I would like to contribute too.

An open source project would be great. However, as you mentioned in your series, it should be a modular project. A typical bot has 3 parts, input (either screen scraping, reading memory) which leads to a table state (bot position relative to the button, player names and amounts, hole cards, current bets on the table). Then the decision making module reads the state and produces one of these outputs; fold, call, bet amount, enter chat text, sit out, close window. Then the third part somehow sends these results to the client. Open Holdem seems decent, the big disadvantage is that it's a monolithic client with these 3 modules all mixed through the code. And you can change a lot in the source, but as soon as you run your compiled exe the pokerroom will immediately detect 'hey that dude is running openholdem', even if you change a lot. If you make the 3 modules separate opensource projects, people can work on supporting more pokerrooms, while other people work on finetuning the decision making rules.

Personally I believe that anyone making a bot should make it for one of the smaller poker rooms. It would be suicide for any bot programmer to even go near the big rooms. Last thing you want is to start working on screen scraping and mouse clicking routines, and by the time you manage to detect the hole cards you're banned off full tilt, partypoker or pokerstars for life. I'd rather get it fully finished on some 3rd rate small site and then change it to work on a major one. After all we still want to play poker for the next years and it would be a shame to get banned from the biggest sites over a poorly written screen scaper that triggered the pokerclient's detection.

I'm sure it can be beneficial, in any case, bot AI will be able to dominate online poker in the not so distant future. If Moore's law continues, and sufficient hand history data is collected from the top percentile players, there is no reason robots won't be able to extract and repeat optimal betting patterns. Going open source will allow you to reach this first inflection point sooner, where the skill of poker bots becomes as good as the AI used in other segments, for example the Kasparov Deep Blue Machine.

I would say this is a great idea, except for the fact that sites will ban it as soon as it becomes popular (as others have mentioned). The only way around this seems to be to use scraping + stealth. Which begs the question: Why not just use openholdem?

Opensource = crowdsourcing with neural nets, put some EA juice on it and let the magic begin.

let us start...

Hey everybody! Im doctor Nick

I was reading and reading, its become quite a long thread, and then i came to all the anit open-sourcing posts. I just wanna calm all yous down a bit.

Worst case senario: Bots overwhelm the poker arena and online poker disapears from the world. Buhu. In what f*ing way is this a bad thing. The economy of thousands of gambling addicts will see a drastic improvment. Those actually capabel of scripting will get some other job its not that bad. You and all the others at least made a few bucks while getting rid of one of the many evils in the world.

Best case senario: Countermeasures become to complex so only a few handfull will be capable of handling them and you are back to being the sole profiteer again.

So chill out and share. Besides building a poker bot is a great way to learn both statistical modelling and object oriented scripting. being inlove with one of them i am eager to see progress in the field, and so should all others.

I think going open source has some merit, as it will allow for more robust software and lower the overall skill required to make significant income from this. IMHO, this will not only increase the popularity of poker bots, it will also increase the IQ of the average bot by a sizable margin.

To an army of robot geniuses,

Cheers, A reader

Great, I have done it.

I've been thinking about this a lot and I noticed that someone above made a comment about a poker site that would actually cater to bots. Make an interface that allows users to upload their own bot, have bot competitions, etc. I think it would attract a lot of live players too (after all, there's nothing better than taking advantage of some poorly programmed bot!).

Someone should get right on that :)

I can foresee poker bot wars pretty soon. That'd be a heck of a contest, btw. I'd be in if this takes off.

and the end of online poker came........

and ur talkin about open-source?


Hi James Sounds an interesting project, where exactly are you with it at the moment as I see this was a few months ago, I would be very interested in getting involved and have a team of programers who already work for me within the gaming industry, I have left my email in the optional box. If your looking for support and hands on get in touch be interested in pitching in

Regards Dave B(UK)

Ideally, there should be a collection of compatible modules which can be set to work together using configuration files expressed in a special XML language. The strategy choices and such could be made in this config file.

This would take a master architecting of the application, including what's needed to work with online poker rooms.

Can open source do that?

I can imagine open source doing it if the underlying application system were Smalltalk or R, but C/C++? Java?

I would use it, if I could...

Making it open source for me would mean really make it work on different architectures. Like, linux/mac?

So, I started my own poker bot some time ago, in Java. but off course you could also use python or ... I picked java since it has a nice javax.robots that allowed me to easily program the user output. Using pixel-test for the input (made plugable, so others could write another one for another client, or for a client update)

I saw openHoldem and really like the initiative, only to bad it's only for windows :(

As I posted earlier, it would be cool to have some sort of pokerbot battle software. Heck, I would like to build a poker software that would simply allow bots to hook up to an SDK to evaluate hands. Then all is clear, good players can simply beat weak bots, or good bots can beat other weak players... Either way, just like in the real world, it is fair play concidering that bots are profitable on the volume of hand played. Heck, if I would be pokerstars, I would make such and SDK, and those hooking up into it would be charges higher rates, which would generate much more $$$, and would limit the bots to certain types of games... Could be fun!

The problem with pokerbots would be the eventuality that poker bots get wired or networked together. Then, if you have a 9 player table, and 8 of the players are linked bots, then the other player is totally screwed...

If I could, I'd create/host that type of poker software, but we would have to find some sort of security feature to prevent linked poker bots, and that is impossible.

Imagine a virus that would spread and use computers around the world to create and use accounts... Then online poker is totally screwed. The only way out of this is to limit the games to heads-up...

Let me know what you think maguindon [at] hotmail (dot) com.

How about this.. We create a paid online gambling site for bots only. The best programmer wins lots of money. Every one else loses! All kidding aside, I'm actually considering it.

You wrote this in the first part of your bot building series: [quote]I debated for a long time whether or not to make this information public, as I'm a poker player myself and have no desire to see the game ruined by an avalanche of poker bots.[/quote] I do not know what have change, but considering to build an agent based all around botting system as an open source project will flood the sites. Lets say the project is successfull and anyone can download a basic bot which can be easily set up and have a not too ugly AI (lets say can make profit in microlimits with honest ABC poker). What would keep back the hoards of mediocre computer users with 50-100$ to spare to flood the sites? So the sites are flooded with micro/low limit bots that probably can make a living with rakeback counted in. They will react and will not spare the money to keep their software on the cutting-edge considering defenses against bots. (do not expect the mediocre users to be able to set up proper stealth configurations or check their setup regurarly) So the open source software will be totally useless for the real botters because the counter-measures. It will be even harder to make a custom bot cause of the same reasons. Even now the entry to botting is not too high, you can find working bots for a few thousand dollars on the net.

Also from the open source developer point of view: there is a lot of comments stating that "I am interested, I will help to do it, I can contribute in the following area: .....". Just ask yourself what are they waiting for? There is openholdem and a few other projects, what is the hold back to contribute to that projects? Most people who are saying they are willing to help are really waiting for someone to do the hard work and can not really contribute. (Most of them can contribute a little time, coding some easy tasks with guidance but at the end they are without any original contribution.)

Some interesting arguments for and against.

Putting the much overlooked but important issue of luck (yes I said it) to one side for a moment, as a keen (marginally profitable) online poker player I am always on the lookout for two things -

  1. Tools that will provide that important (even miniscule) edge over opponents.

  2. Ways to make the physical and mental characteristics of the game quicker and less arduous (ease of multitabling, reducing or eliminating mouse clicks, the acquisition, use and presentation of opponents data and so forth…

My experience is that as in many pursuits, there are a multitude of ways of attacking the game of poker. Witness the number of books, guides and websites devoted to the analysis of the subtleties of the game. These different approaches, beliefs and methods can be described as ‘Game Philosophy’.

To be interesting, educational and successful, a Poker Bot should, in my view, be capable of accepting personalised Game Philosophy ‘plug ins’ that are easy to create, program and utilise.

It could be that in the fullness of time, one particular Philosophy may, by a process of natural selection, prove to be more successful in particular aspects of the game(s) than others.

So yes, lets have an Open Source Bot but please give it ‘a slot’ where literally anyone and everyone can with minimal effort, produce and plug in their own personal ‘Game Philosophy’. Maintain the unpredictability of the game and the fun will really begin.

But remember – “Don’t let anyone ever tell you that poker ain’t a game of luck”.


Does that say [b]RAKE ASSHOLES[/b] on the edge of your book??

Is there any compendium or blog or collection which tracks countermeasures poker sites use to frustrate attempts to scrape information from them, or to get bots to play at them? I'm sure it is or may become an "arms race", but finding out how the sites work should be the first thing to try. For instance, are free access "for play money" GUIs different than "for money" GUIs, in some substantial way other than appearance? How do these measures change with time? It seems to be there should be an entry-level "bot", one which is capable of monitoring what's happening at a screen poker table and reporting it, irrespective of the site. Then more complexity could be added.


I'm a german Software Developer and Poker Half Pro.

Actually I Work as a Firmware Developer for Idustry Automation and therefore C/C++ knowledge is there. I also started to code my own bot times ago and had to fizzle out all the DLL-Injection etc. Stuff for my own (sadly I havent read your Blog). Since I have absolutly few experience coding for Windows, but a lot of experience coding for various Microcontrollers (mostly on ARM or PPC Platforms under vxWorks) maybe I could contribute in AI Development.

In my Poker-Career I had several times where Pokerplatforms sponsored me (GNUF, Blackmoonpoker) but I never made it to the top. But you can definitly asume some good Poker-Knowledge.

So If you want me to parcipiate (and tolerate someone with a realy bad english) just send me some mail....


i don't understand. Where i get the Code to test and to Programm.


This room looks like the scene from "life of Brian" , yes we need to stop talking and take action, yea, lets stop talking and do something. LOL

I myself am working in the gaming industry, and we are actually developing a automated poker machine, i'm all for "open source", so i'm am willing to supply you with some source that is using a AI poker bot. its writen in visual C# (argggg), my self more like Delphi.

Anybody really serious about this, and maybe has the skills to pore it over to Delphi, would be really cool.

Please drop me a line.

Greetings, Alphons

Good website to start looking if interested in programming poker games. This is just for "Delphi", but it can also help you as a sample.

Use the form below to leave a comment.

Coding the Wheel has appeared on the New York Time's Freakonomics blog, Jeff Atwood's Coding Horror, and the front page of Reddit, Slashdot, Digg.

On Twitter

Thanks for reading!

If you enjoyed this post, consider subscribing to Coding the Wheel by RSS or email. You can also follow us on Twitter and Facebook. And even if you didn't enjoy this post, better subscribe anyway. Keep an eye on us.

Question? Ask us.



Coding the Wheel =
Code, poker, technology, games, design, geekery.


You've read our technical articles, you've tolerated our rants and raves. Now you can hire us anytime, day or night, for any project large or small.

Learn more

We Like

Speculation, by Edmund Jorgensen.