javascriptpythongoogle-chromeprogram-structure

Am I on the right path to build an online game bot?


I am by no means a programmer or a developper or anything like that but I'm very passionate about machine learning and AI.

I don't even know if I'm using the right words to describe my question so please bear with me (it should be simple to answer)

Basically I decided to learn some programming languages with a project: make an online game bot (it's for educational purposes only and the beauty of this game is how everything you do inside of it complies with the rules ahaha)

Just so you know it is a web based MMORSG game (less than 100 players but big universe). The game does not consist of any actions or 3d objects (it's like chess)

Here is what the program should do(1 and 2 are FYI, 3 is the problem I need help with):

1.navigate through different web pages and scan some html parts of the website in order to store data (such as ranking, player stats, coordinates, etc)

2.save all this data, probably on a SQL database (the more info it tracks over time, the more calculated decisions it should be able to make)

3.execute tasks on the game (for sake of this post, let's say this means just getting 1 and 2 actually executed on Chrome as one task and not 100 different scripts)

Additional information: I am actually able to execute all game tasks by javascript manually on chrome console.

PROBLEM IS: A python script on my computer HAS to send the executive orders somehow to the game. Selenium kind of does what I want but not exactly neatly, because ultimately, the system should be able to manage multiple pages on the browser simultaneously, and preferably do not take control over my mouse and keyboard (I'm not making macros)

The closest end result I can come up with is some sort of a Chrome extension who can make a API like interaction with the python script on my computer, and basically just do what python wants it to do. This enables python to manage and control every single open tab on the browser. Finally, python should also have master controls (open close tabs and windows etc but I think this part is simple it can even be done with an apple shell script.)

My question is: does such a program already exist? if not, what do you think is the best way to do it? Where do I start?

Please feel free to give me any feedback that you think will help, this piece I picked is way bigger than my mouth and I honestly don't even know if I'm underestimating the task here or making it more complicated than it should be.

However I am determined to finish this project :)


Solution

  • To accomplish a task like this I would probably use Puppeteer.js and page.mouse.click(x, y); to manage clicking and whatnot. The best ways to build bots for a game though are to create a "bot client". Finding a way to sit between the data sent from a server and create your own interface to interpret that information is going to allow you to have a more fine tuned control of how your bot works. Of course, there are also color detection bots, and depending on the type of game there are many ways to automate tasks.