Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10089 > unrolled thread

Re: Writing a MUD Console

Started byChris Angelico <rosuav@gmail.com>
First post2011-07-22 19:25 +1000
Last post2011-07-22 19:25 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Writing a MUD Console Chris Angelico <rosuav@gmail.com> - 2011-07-22 19:25 +1000

#10089 — Re: Writing a MUD Console

FromChris Angelico <rosuav@gmail.com>
Date2011-07-22 19:25 +1000
SubjectRe: Writing a MUD Console
Message-ID<mailman.1356.1311326741.1164.python-list@python.org>
On Fri, Jul 22, 2011 at 6:20 PM, Jonathan Gardner
<jgardner@jonathangardner.net> wrote:
> I had this idea on an easy way to write a MUD console.
>
> Basically, you start a program written in Python. This will connect to
> the MUD of your choice, and otherwise behave like Telnet. In fact, it
> will just spawn telnet to do all the hard work for you.

The "hard work" as you call it is simply: Open socket connection
(possibly a DNS lookup), and parse some fairly simple TELNET codes
(stuff like "go into password mode").

> As you type commands, they are piped directly into the telnet process
> as MUD input commands. Commands that start with ! or maybe # will be
> intercepted, however, and interpreted as special commands
>
> Also, as output comes back, you can put hooks in to react to the data
> and execute Python functions, or pipe the data to subprocesses you may
> spawn. For instance, you might spawn a subprocess that opens up a
> window to show your current map location. When the MUD sends the map,
> it is intercepted and directed to this map subprocess. Your status
> line could be interpreted and displayed in another window in graphical
> format.

Yep, these sorts of ideas are fine. And will work just as easily when
you do the socket connection yourself.

In the early days of Android, my brother couldn't find a decent MUD
client, so I whipped one up for him in Python. The project never went
very far, but it's a start. It works on Linux, not Windows; but since
you're referring to /usr/bin/telnet I assume that's not going to be a
problem for you!

Rather than attach it to this post, I've tossed the script onto my
MUD's web site. (Yes, I run a MUD. Your subject line grabbed my
attention!) Grab it from http://minstrelhall.com/RosMudAndroid.py and
give it a whirl!

I haven't tested the code lately. I don't remember whether it's for
Python 2 or Python 3.

Feel free to pester me with questions; I've written several MUD
clients (in various languages) and a couple of MUD servers, and would
be happy to share oddments of code with you.

Chris Angelico
aka Rosuav

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web