For the purpose of self-education (and fun of course) i'm trying to automate a play process in a certain web game, which is essentially a website which allows you to play using an HTML5 canvas element and then gives you the results as a regular (i.e. not using the canvas) webpage.
The algorithm i wanna implement is roughly like this:
- Open the website and log into my profile.
- Navigate to the page with the game and launch it.
- Scan the input data provided by the game and drawn on the canvas element.
- Play the game by performing actions that are expected to be done with a mouse (moving the cursor around, clicking and holding the mouse buttons etc).
- Parse the output data generated by the game, correct the playing strategy if needed.
- Go to step 2 and repeat.
I'm an experienced software developer, but never coded anything substantial for the web, nor have i ever done any website automation. So i don't have any preferences about the possible tools that can do the job i described. But while i welcome suggestions of just about any tool that could get the job done, there are several "is it possible" things that i'm curious about.
So, is it possible:
- To extract data drawn on HTML5 canvas without employing computer vision, i.e. by maybe somehow intercepting the client-side code that draws on it and receiving the game input data directly instead of analyzing the drawn image?
- To make the actual gameplay visible, as if the browser (or any other piece of software capable of rendering a webpage) was playing the game on itself? I kinda want to watch the matches go =).
- To retain some information between matches, so that the automatic playing algorithm could learn from its mistakes and adapt?
Any suggestions would be appreciated. Thanks!
Aucun commentaire:
Enregistrer un commentaire