-1

I have two questions regarding poker calculation (e.g. calculate odds) apps.

  1. How do poker apps work generally? I mean which technique is used to find the cards on the screen and to get their value? There must be an algorithm filtering the whole screen or game window for cards and assigning the values to the players. Furthermore it needs to find my position at the table and create an order of players. To me, this sounds very complex. Are there maybe common frameworks which are used for this purpose or is this a wrong approach?
  2. Is it somehow possible to build a poker odd calculator for web browser based poker rooms in javascript?

Thanks!

Pawel
  • 1,560
  • 1
  • 10
  • 11

2 Answers2

1

The poker tracking software available works by reading hand histories - these vary between the different poker sites, but are generally small text files saved to the user's local appdata folder. There are two problems with this relevant to developing a browser based odds tracker:

  • Most browser-based poker rooms do not save hand history locally.
  • Even if they do save hand histories locally, you don't have permission to access them from browser-running JavaScript.

A JavaScript solution is possible, but you would have to have a locally running backend, such as a Node.js server, in order to access the hand history files. You could then have API endpoints that a browser-based app could hit to get the data. Conceptually this is little different to the currently available options, just a different technology stack.

The other factor to consider is what technology is being used by the poker room itself. In my experience the majority of these are either Flash or Silverlight - to my knowledge there is no way to easily get data out of these. If you were to find a poker room that had a JavaScript based app, then it is theoretically possible to run a user script on top of this, and respond to certain events in the poker room's script. I say theoretically because this would require fairly intimate knowledge of their code, which will almost certainly have been obfuscated before delivery.

In short, I don't think this is generally feasible.

Alex Young
  • 4,009
  • 1
  • 16
  • 34
  • Thank you for the detailed answer. The accessibility of data is my problem. Even though I know a poker room using html 5 and javascript their code is really sophisticated. That's why I thought of building something that scans the screen or iframe in a node app for cards. For example the app could take snapshots of certain parts of the table and compare it to images saved for each card. So it would work like a pattern or image recognition. – Pawel Dec 05 '16 at 10:35
-1

This might not be the best implementation of poker in JavaScript. It was really just an experiment in making a functional game entirely with JS. So, here you have a full program, where you can view the source.

JavaScript Poker Machine

You'll see that the methods for identifying and ranking hands is broken up into smaller sections. I'm sure much of it could be more efficient, but this will give you some good ideas.

durbnpoisn
  • 4,666
  • 2
  • 16
  • 30
  • Seriously? Someone downvoted this answer?! What is wrong with you people? – durbnpoisn Dec 03 '16 at 13:46
  • I didn't downvote, but I think you misunderstood the question – the OP is asking about odd calculators that "sniff" existing poker apps and calculate the odds of currently played hands. He doesn't want to make a poker app of his own, he wants to know how to pull the card data from other apps. – JJJ Dec 03 '16 at 13:54
  • I totally didn't read it that way. I thought OP was looking for help in how to identify hands. Well, I'm gonna leave this here anyway. Even with the loss of points. Someone might find it helpful – durbnpoisn Dec 03 '16 at 13:59