[Tutor] How to connect a MUD client?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Jul 30 02:42:35 CEST 2004



On Fri, 30 Jul 2004, W X Liu wrote:

> I want to use python to wrote a program to connect a MUD client
> (mudlib.anarres.org port:5000) and simply show a " hello" on the MUD
> interface.

Hi W X Liu,


You may want to look at telnetlib:


    http://www.python.org/doc/lib/module-telnetlib.html


For example:

###
>>> tn = telnetlib.Telnet('mudlib.anarres.org', 5000)
>>> tn.read_very_eager()
'Welcome to Anarres II\r\n\r\nRULES:\r\n1) Code may be distributed only
with permission from Arren.\r\n2) Do not harass or abuse people.\r\n3) You
may encounter material which you consider offensive.\r\n\r\nThe official
address of this MUD is mudlib.anarres.org port 5000.\r\nPlease make SURE
that you are using that address and not an alias.\r\n\r\nNew users or
guests may log in with any name.\r\n\r\nWARNING === WARNING === WARNING
[... text cut]
###


So you should be able to communicate with your MUD with telnetlib.


Good luck to you!



More information about the Tutor mailing list