So it looks like what the author of the question wants is basically to hack server calls of web based games?
If that's the case I'm adding another answer which is very different from my first answer
Fiddler is a web debugging proxy. It will let you setup a proxy between you(the client) and the server.
The proxy has a ton of configurations will will let you save sessions, replay sessions, pause AJAX requests and edit them on the fly.
It can log all AJAX requests so you could build a HTTP robot which could simulate playing the game.
Fiddler was originally created by a PM at Microsoft for debugging websites, and web interactions of applications.
Why bother writing the boring interface code and use AI Api's directly? Program the AI not the interaction with the game itself.
The very popular BroodWars API allows for commanding all the units to do anything a real player could. You can even battle against other players or AI's with your AI
This API allows for you to control Mario! It was a contest for the best level generation and fastest level completion AI. (A* actually won)
There is currently a contest for the best Galcon AI, a Google AI Challenge. Of course Galcon API is provided.