views:

549

answers:

2

There are some HTML based games (ie bootleggers.us) that have a simple login form and after that your entire game experience revolves around submitting various forms and reading information from the website itself.

My Question is, what is the best way to go about writing a bot / automate the html-based game using C#?

My initial thought is to use the System.Net.HttpRequest and WebRequest classes to get the source html and parse using regexs to get the desired information.

However, I would like to avoid this if it is at all possible. Are there any solutions that abstract away some of this and make automating website interaction easier? Ie filling out forms, submitting forms, reading values from the website, etc? Some library?

+3  A: 

You could use Watin: http://watin.sourceforge.net/

Joel Martinez
Looks like a good tough!
Pascal Paradis
I've already gotten some code written using WatiN and it is great! It isn't even intended for this purpose and it is exactly what I need.Thanks
Simucal
A: 

No, you're pretty much going to have to "screen scrape" every page. You might consider writing most this in JavaScript instead of C#. Depending on the HTML of the game site, this could be more or less difficult depending on whether they provide good id attributes on the page elements, etc...

SoloBold