Register to reply

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

by brushman
Tags: game, language, mud or online, programming
Share this thread:
brushman
#1
Mar5-10, 10:59 PM
P: 116
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.
Phys.Org News Partner Science news on Phys.org
Physicists discuss quantum pigeonhole principle
Giant crater in Russia's far north sparks mystery
NASA Mars spacecraft prepare for close comet flyby
davee123
#2
Mar6-10, 06:25 AM
P: 657
Quote Quote by brushman View Post
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
DavidSnider
#3
Mar6-10, 09:26 AM
PF Gold
P: 469
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.

davee123
#4
Mar8-10, 02:08 PM
P: 657
What language is best for programming a MUD/online game bot?

Quote Quote by DavidSnider View Post
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 in to 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


Register to reply

Related Discussions
Which programming language do you use? Academic Guidance 20
Which programming language to learn? Computing & Technology 18
Which programming language is the best ? Programming & Computer Science 15
C programming language Programming & Computer Science 1
Programming language in Biology Biology 10