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


Groups > comp.lang.python > #10089

Re: Writing a MUD Console

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.04; 'socket': 0.04; 'sorts': 0.04; 'instance,': 0.05; 'behave': 0.07; 'decent': 0.07; 'url:py': 0.07; 'python': 0.08; '(possibly': 0.09; 'hooks': 0.09; 'spawn': 0.09; 'subprocess': 0.09; 'displayed': 0.11; 'output': 0.11; 'wrote:': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'piped': 0.16; 'react': 0.16; 'subject:Console': 0.16; 'work"': 0.16; 'pm,': 0.16; 'written': 0.17; 'functions,': 0.19; 'onto': 0.19; 'received:209.85.210.174': 0.19; 'received:mail-iy0-f174.google.com': 0.19; "haven't": 0.21; 'input': 0.21; 'linux,': 0.22; 'maybe': 0.22; 'header:In-Reply- To:1': 0.22; 'assume': 0.23; 'interpreted': 0.23; 'opens': 0.23; 'parse': 0.23; 'referring': 0.23; 'code': 0.24; '(in': 0.26; 'fri,': 0.28; 'attach': 0.28; 'yourself.': 0.28; 'message- id:@mail.gmail.com': 0.28; 'script': 0.29; 'fine.': 0.29; 'sends': 0.29; 'problem': 0.29; 'fairly': 0.30; '22,': 0.30; 'basically,': 0.30; 'commands,': 0.30; 'far,': 0.30; 'languages)': 0.30; 'subject:Writing': 0.30; 'chris': 0.32; 'rather': 0.33; "i've": 0.33; 'to:addr:python-list': 0.34; 'however,': 0.34; 'couple': 0.34; 'project': 0.35; 'dns': 0.35; 'format.': 0.35; 'idea': 0.36; 'connection': 0.36; 'jonathan': 0.37; 'open': 0.37; 'some': 0.37; 'but': 0.37; 'several': 0.37; 'could': 0.37; 'another': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'put': 0.38; 'run': 0.39; 'went': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'might': 0.39; "couldn't": 0.40; 'received:209': 0.40; 'give': 0.60; 'your': 0.60; 'easily': 0.61; 'subject': 0.62; 'you.': 0.62; 'grab': 0.63; 'free': 0.63; 'show': 0.67; 'brother': 0.67; 'special': 0.67; 'share': 0.68; 'site.': 0.69; 'directed': 0.80; 'commands.': 0.84; 'intercepted,': 0.84; 'aka': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4GwzjLqrwEU/GVElSqwMCYHEE0s4Zp3Ny4QisXGJFp8=; b=q1zbbv5fqhytv9Zk523cj8prHzJsC8fHm91TAbf2+w/xwuuYe4ki+ezC9Pq8XwP26F 9NHZB79Loplq6+hFG6+JnYi+2mj9rqDnwf3ym0swCOlMnB8c58Gd9PUzGilcd0E7xo6w F6YWSPRxQoMzXpiBB7ONKJiZ0xGuCA6587GxI=
MIME-Version 1.0
In-Reply-To <CAG9FJoSUij72C39LtH=c122Cw8Y663N3q=Eq3nNnDiSdRKrVVw@mail.gmail.com>
References <CAG9FJoSUij72C39LtH=c122Cw8Y663N3q=Eq3nNnDiSdRKrVVw@mail.gmail.com>
Date Fri, 22 Jul 2011 19:25:38 +1000
Subject Re: Writing a MUD Console
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1356.1311326741.1164.python-list@python.org> (permalink)
Lines 47
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311326741 news.xs4all.nl 23843 [2001:888:2000:d::a6]:60873
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10089

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web