What language is best for programming a MUD/online game bot?

Click For Summary

Discussion Overview

The discussion revolves around the best programming language for creating a bot that can perform basic functions in online games, specifically mentioning examples like Facebook's FarmVille. Participants explore various technical aspects, including authentication, network protocols, and the challenges of bot development in this context.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants suggest that most programming languages could be suitable for creating a bot, including C, C++, Java, Perl, and Python, depending on the specific tasks involved.
  • One participant emphasizes the importance of understanding web protocols and authentication processes over the choice of programming language.
  • There is mention of using tools like WireShark to analyze network traffic and understand the data being sent to servers, which could aid in bot development.
  • Concerns are raised about the complexities of authentication, particularly in relation to Facebook's login system and the need to replicate cookies and tokens for successful bot operation.
  • Participants discuss the potential risks of getting banned from games for using bots, noting that the extent of automation may influence the likelihood of being penalized.

Areas of Agreement / Disagreement

Participants express differing views on the technical challenges involved in bot development, particularly regarding authentication and the use of network analysis tools. There is no consensus on the best programming language or approach, and the discussion remains unresolved.

Contextual Notes

Limitations include uncertainty about the specific authentication mechanisms used by games like FarmVille and the potential for varying degrees of complexity in replicating user actions through a bot.

brushman
Messages
112
Reaction score
1
My goal is just a simple bot that could "play" or do basic functions without human aid, on a online game of some sort, for example facebook's farmville or something similar.
 
Technology news on Phys.org
brushman said:
My goal is just a simple bot that could "play" or do basic functions without human aid, on a online game of some sort, for example facebook's farmville or something similar.

What definition of MUD are you using? The only one I'm familiar with is "Multi-User Dungeon", which was generally a text-based online game-- sort of a do-it-yourself style MMOG from the 90's.

Anyway, I think most programming languages would be pretty equal to the task, although if you're planning to dissect the HTML and JavaScript, you'll probably want something with strong regular expression handling.

Otherwise, you can accomplish the same feat quasi-manually, depending on the task at hand. You'll have to examine and duplicate the cookies used in the browser (so the bot has to be able to "log in" as a believable entity), possibly duplicate the browser type, and determine the correct series of HTTP calls to use for the tasks you have in mind. You may be able to get these using Firefox's HTTP Live Headers plugin, and slogging through all the calls you're making; then replicating them in your bot with a pretty standard HTTP call library.

I guess the thing I don't know would be how to effectively "hack in" to things like Flash or Silverlight applications. THAT's hard. They can connect back to their servers in whatever method they choose, so it depends on the application.

I think in general, it'll take more knowledge of how the web works to get this going as opposed to programming language requirements. You could write this in C, C++, Java, Perl, Python, or probably a good dozen more popular languages. Heck, you could probably write it in JavaScript!

Anyway, good luck!

DaveE
 
You don't need to hack into flash for most of these games. Most have a very simple network protocol. If you use something like WireShark to see what a game like FarmVille actually sends to the server it's a plaintext string like "Plow: [{0,0},{0,1},...]"

It will probably end up getting you banned though.
 
DavidSnider said:
If you use something like WireShark to see what a game like FarmVille actually sends to the server it's a plaintext string like "Plow: [{0,0},{0,1},...]"

I guess I was curious more along the lines of authentication-- the data itself I would guess is simple, but I have no idea how the authentication works. I assume it works in correlation with Facebook to get the initial authentication going, and from then on sends an identity token of some sort with each request? Not that it couldn't do its OWN bizarre auth protocol each time if it felt like being nasty!

Anyway, that's the part I would assume would be tricky? To initiate it for Farmville in particular, I would think you'd need to be able to log into Facebook automatically (no idea how hard that is, but probably not easy), replicate the cookies, and possibly traverse some oddities with the remote server until you got a valid token to pass. Is there anything out there that will auto-login to Facebook via an API? I admittedly haven't even so much as Googled it (shame on me!).

The flipside might be a bit easier, but require some manual effort, like logging in manually, and copy/pasting the already-validated cookie into your code (along with other potentially necessary info like the USER_AGENT, and so forth, that they might use to double-check. That's relatively simple; it's just not quite as automatic.

As for banning, I guess it depends on what you're doing with it. I've never played Farmville, but for other games I've played there's a limit to how much you can do. So having a bot log into play for you probably isn't too bad, unless there ISN'T a limit. It'd be more like having a bot play for you while you were away on vacation, or to make sure you didn't forget to do your daily routine.

The other banning potential is of course if you're making false accounts and having bots play them. That's against the rules for Facebook, and possibly other sites as well.

DaveE
 

Similar threads

  • · Replies 397 ·
14
Replies
397
Views
21K
Replies
4
Views
2K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
4K
Replies
4
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K