Screen Scraping Question

J

jeffbg123

Hey,

I am trying to make a bot for a flash game using python. However I am
having some trouble with a screen scraping strategy. Is there an
accepted way to compare a full screenshot with the image that I want
to locate? It is a math based game, so I just have to check what
number, 1-9, appears in the center of the flash game. Is there an
easier method to do this?

Thanks

-Jeff
 
D

Dan Stromberg - Datallegro

Hey,

I am trying to make a bot for a flash game using python. However I am
having some trouble with a screen scraping strategy. Is there an
accepted way to compare a full screenshot with the image that I want
to locate? It is a math based game, so I just have to check what
number, 1-9, appears in the center of the flash game. Is there an
easier method to do this?

Thanks

-Jeff

That sounds like an OCR problem, unless the numbers are so consistently
rendered that you can just store copies of all 9 (I'd pick a non-lossy
format) and compare.
 
J

jeffbg123

That sounds like an OCR problem, unless the numbers are so consistently
rendered that you can just store copies of all 9 (I'd pick a non-lossy
format) and compare.

The numbers are always rendered the same. So I don't know if OCR is a
necessary step.

Also, what if I just got the data from the packets? Any disadvantages
to that? Any good python packet capturing libraries?

Thanks
 
R

Raul Laansoo

Ühel kenal päeval, K, 2007-07-11 kell 12:45, kirjutas jeffbg123:
Hey,

I am trying to make a bot for a flash game using python. However I am
having some trouble with a screen scraping strategy. Is there an
accepted way to compare a full screenshot with the image that I want
to locate? It is a math based game, so I just have to check what
number, 1-9, appears in the center of the flash game. Is there an
easier method to do this?

Thanks

-Jeff
Maybe you can compare screenshots by the size, if they vary.

Raul
 
Y

Yu-Xi Lim

jeffbg123 said:
The numbers are always rendered the same. So I don't know if OCR is a
necessary step.

Also, what if I just got the data from the packets? Any disadvantages
to that? Any good python packet capturing libraries?

Thanks

Packet capture is probably a bad idea for two reasons.

1) It will give you a lot of packets you don't need and at a OSI layer
so low that reassembly is painful. Try writing a HTTP or SOCKS proxy and
get the Flash game to use that proxy.

2) Many Flash games would probably store (in the Flash file) or generate
their scenarios instead of retrieving them over the Internet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top