home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / games / mymud.el < prev    next >
Encoding:
Text File  |  1991-06-03  |  55.5 KB  |  1,143 lines

  1. ;-*- mode: Emacs-Lisp -*-
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;
  4. ; File:         mymud.el
  5. ; Version:      1.20 (> 1.9)
  6. ; RCS:          $Header: $
  7. ; Description:  Another mud client in emacs
  8. ; Author:       Carl Edman
  9. ; Created:      Sun Dec 21 16:39:00 1990
  10. ; Modified:     Tue May 14 16:06:58 1991 (Carl Edman) cedman@lynx
  11. ; Language:     Emacs-Lisp
  12. ; Package:      N/A
  13. ; Status:       Release
  14. ; Copyright:    This program is perfect freeware. Do with it whatever you want.
  15. ;
  16. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  17. ;
  18. ; Revisions:
  19. ;
  20. ; Thu May  9 11:42:05 1991 (Carl Edman) cedman@lynx
  21. ;  Again added quite a bit of things to the DikuMUD-Setup. Soon really all
  22. ;  the features of the LPMUD-mode will be there.
  23. ; Wed May  8 09:39:50 1991 (Carl Edman) cedman@lynx
  24. ;  New variable: mymud-kill-empty-lines. Should lines which are completely
  25. ;  empty be deleted ? Added for the benefit of dikumud players who otherwise
  26. ;  get over 60% empty lines on their screens. Why does DikuMUD insist on
  27. ;  flooding you with empty lines ? (Even 'compact' does not diminish their
  28. ;  number a lot). And why does it have to repeat the bloody prompt after
  29. ;  every other output ?
  30. ; Wed May  8 09:38:57 1991 (Carl Edman) cedman@lynx
  31. ;  Dikumud mode much expanded. Now it parses the 'score' command and puts all
  32. ;  relevant data into the status line. Also a few other things about it have
  33. ;  been fixed up
  34. ; Tue May  7 22:41:40 1991 (Carl Edman) cedman@lynx
  35. ;  Tabs are now expanded before triggers are checked
  36. ; Tue May  7 22:41:09 1991 (Carl Edman) cedman@lynx
  37. ;  Put robot parts into public source (call Robot-Setup in player customization
  38. ;  and set mymud-master to the name of the player the robot should obey)
  39. ; Tue May  7 20:21:26 1991 (Carl Edman) cedman@lynx
  40. ;  New variable : mymud-prompt. It selects how the prompt _in_the_display_
  41. ;  should look. Better do not set this to something which might trigger
  42. ;  a mymud-aa (like the prompt used by the server itself). I might fix that,
  43. ;  as soon as I find an easy and compatible way to do that.
  44. ; Tue May  7 20:16:45 1991 (Carl Edman) cedman@lynx
  45. ;  More big changes ! (I thought that I might as well make everyone else mad
  46. ;  at me at once :-)) The main parsing routine mymud-filter has been completely
  47. ;  rewritten. Now it is almost elegant and might actually work. (I just hope
  48. ;  that all old copies of this routine will be deleted before someone connects
  49. ;  them with me). From now on when a mymud-aa leaves a line empty (only consisting
  50. ;  out of spaces) the line gets removed. Hence from now on, leave off the
  51. ;  "\n" at the end of mymud-aa's. If you don't mymud.el can get confused
  52. ;  badly. If you do, mymud.el will Do The Right Thing. This also fixed a few
  53. ;  bugs in the parser which I wasn't able to locate before.
  54. ; Tue May  7 18:07:18 1991 (Carl Edman) cedman@lynx
  55. ;  Big change ! From now on ctrl-m's wont any longer be replaced by spaces
  56. ;  but completely removed. This may cause the change in many regexps, which
  57. ;  depended on those extra spaces at the end of lines, but DikuMud users
  58. ;  convinced me that this change is necessary. Dikumud puts ctrl-m's all
  59. ;  over the place !
  60. ; Sun May  5 18:55:29 1991 (Carl Edman) cedman@lynx
  61. ;  Added nw,ne,sw,se as directions
  62. ; Sun May  5 09:29:21 1991 (Carl Edman) cedman@lynx
  63. ;  Added some documentation
  64. ; Sun May  5 09:03:52 1991 (Carl Edman) cedman@lynx
  65. ;  Now all actions which match are executed, not only the first one
  66. ;  The main parsing loop sorely needs some cleaning up
  67. ; Sat May  4 20:42:05 1991 (Carl Edman) cedman@lynx
  68. ;  Started adding support for Afterhours LPMUD
  69. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  70. ; A note on version numbers:
  71. ; Mymud is currently in a stage in which the almost all changes to it are
  72. ; simply adding another independent feature or fix another bug. Doing this
  73. ; takes only a little while, so many small changes are made. Hence the version
  74. ; numbering scheme works like this: Every time someone asks me for a version
  75. ; of mymud.el, and there have even been minor changes to mymud.el since I
  76. ; gave the last copy to someone else, I bump the version number and hand
  77. ; out the latest version. So don't be surprised if the version number goes
  78. ; up by five during one day. The real amount of work done is not proportional
  79. ; to the version numbers.
  80. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  81. ; If you can not put mymud somewhere in the load-path, simply load-file it
  82. ; before every first use in an emacs (Type ESC x load-file RET
  83. ; ~/emacs/mymud.el (assuming that you put mymud.el in your subdirectory
  84. ; "emacs")).
  85. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  86. ; Notice to novice users of LPMud and DikuMud modes !
  87. ;
  88. ; By default hitting 'return' queues the commands on the current line and sends
  89. ; them one by one each time the MUD server sends a prompt. This may not be
  90. ; desirable if the current line is intended as an answer to a non-standard
  91. ; prompt like "What is your name: " or "Password: ". To override this "smart"
  92. ; behavior hit the 'Escape' key before the 'return' key. Then the current line
  93. ; will be sent to the server without waiting for prompts or parsing it into
  94. ; subcommands a.s.o.
  95. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  96. ; If you create your own setups for the muds and mud types you use
  97. ; (particularly the DikuMUD setup could use some enhancement) then by all
  98. ; means send them to me. They will be included in the next release of MyMud.
  99. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  100. ; An example of what you could put into your ~/.emacs file:
  101. ; (Only the autoload line is really necessary. The rest are just ideas to
  102. ;  customize your logins)
  103. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  104. ;
  105. ; (autoload 'mymud "mymud" "My favorite mud-client" t)
  106. ;
  107. ; (defun Alderon-User ()
  108. ;   "My login as 'user' to Alderon."
  109. ;   ; Call the setup for a particular mud type (or particular mud if available)
  110. ;   ; always first in your personal setup
  111. ;   (Alderon-Setup)
  112. ;   ; Not a necessary line. Just an example of a simple customization:
  113. ;   ; Define x to be an abbreviation for examine
  114. ;   (mymud-short "x" "examine ")
  115. ;   ; If you to be logged in automatically enter your name and password here
  116. ;   (mymud-disp-set 'mymud-name "User")
  117. ;   (mymud-disp-set 'mymud-password "Userpassword"))
  118. ;
  119. ; (setq mymud-command-window-height 10 ; I like _big_ command windows
  120. ;       mymud-separator "."            ; Just like in the old Infocom games
  121. ;       mymud-kill-empty-lines t       ; I play dikumud a lot.
  122. ;       mymud-prompt ">>>"
  123. ;       mymud-private-sites
  124. ;    '(("Alderon-User"       "alderon.lanl.gov"          2000 Alderon-User)
  125. ;      ("LocalLPMud"         "local.user.edu"             500 Lpmud-Setup)))
  126. ;
  127. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  128. (provide 'mymud)
  129.  
  130. (defvar mymud-command-window-height 5 "* size of the command window")
  131. (defvar mymud-use-full-screen t "* delete other windows when mymud is started ?")
  132. (defvar mymud-separator ";"
  133.   "* special character(or string) which separates commands.")
  134. (defvar mymud-min-brief-length 8
  135.   "* minimum length of a goto-command to cause 'brief' to be inserted
  136.  before and 'verbose' after. Nil means never.")
  137. (defvar mymud-debug nil
  138.   "Always set this to nil unless you know what you are doing.")
  139. (defvar mymud-prompt " > "
  140.   "The prompt which is displayed on the screen.")
  141. (defvar mymud-kill-empty-lines nil
  142.   "Should lines which contain only whitespace be displayed at all ?")
  143. (defvar mymud-private-sites nil
  144.  "Your personal logins. They get added to the complete list when mymud is loaded.")
  145.  
  146. (defun Tinymud-Setup () ; Just a dummy to be called on startup
  147.   "Default setup function for all TINYMUDs, either called directly or first command in the setup function for a specific TINYMUD"
  148.   )
  149.  
  150. (defun Tinymush-Setup () ; Just a dummy to be called on startup
  151.   "Default setup function for all TINYMUSHes, either called directly or first command in the setup function for a specific TINYMUSH"
  152.   )
  153.  
  154. (defun Dikumud-Setup ()   ; Very incomplete
  155.   "Default setup function for all DikuMuds, either called directly or first command in the setup function for a specific DikuMuds"
  156.   (mymud-set-key "\r" 'mymud-queue-command)
  157.   (mymud-set-key "\M-\r" 'mymud-send-command)
  158.   (mymud-disp-make 'mymud-name nil)
  159.   (mymud-disp-make 'mymud-password nil)
  160.   (mymud-disp-make 'mymud-cur-hp "10")
  161.   (mymud-disp-make 'mymud-max-hp "10")
  162.   (mymud-disp-make 'mymud-cur-sp "10")
  163.   (mymud-disp-make 'mymud-max-sp "10")
  164.   (mymud-disp-make 'mymud-cur-mp "10")
  165.   (mymud-disp-make 'mymud-max-mp "10")
  166.   (mymud-disp-make 'mymud-xp "0")
  167.   (mymud-disp-make 'mymud-gold "0")
  168.   (mymud-disp-make 'mymud-character-age "21 years")
  169.   (mymud-disp-make 'mymud-age "0 days and 0 hours")
  170.   (mymud-disp-make 'mymud-title "beginner")
  171.   (mymud-disp-make 'mymud-level "1")
  172.   (mymud-disp-make 'mymud-position-status "standing")
  173.   (mymud-disp-make 'mymud-hunger-status "unhungry")
  174.   (mymud-disp-make 'mymud-thirst-status "unthirsty")
  175.   (mymud-disp-make 'mymud-brief-status "Brief")
  176.   (mymud-disp-set 'mode-line-format '("" (mymud-queue "* " "  ") mymud-name "," mymud-title " Hp:" mymud-cur-hp "/" mymud-max-hp " Mana:" mymud-cur-sp "/" mymud-max-sp " Move:" mymud-cur-mp "/" mymud-max-mp " Gold:" mymud-gold " Xp:" mymud-xp " (" mymud-hunger-status "," mymud-thirst-status  "," mymud-brief-status "," mymud-position-status")" ))
  177.   (mymud-aa "By what name do you wish to be known? *"
  178.             '((if mymud-name (mymud-dispn mymud-name)
  179.                 ) nil))
  180.   (mymud-aa "Password: " '((if mymud-password
  181.                                (progn
  182.                                  (mymud-send mymud-password)
  183.                                  (mymud-dispn ""))) nil))
  184.   (mymud-aa "> "
  185.             '((mymud-purger 0)
  186.               (cond
  187.                ((equal mymud-queue '()) )
  188.                ((equal mymud-queue 'last) (setq mymud-queue nil))
  189.                (t (mymud-command (car mymud-queue))
  190.                   (setq mymud-queue (cdr mymud-queue))))
  191.                t))
  192.   (mymud-short "it"
  193.      '((if (string-match "^\\w* \\w*.*$"
  194.                          (mymud-disp-var 'mymud-last-command))
  195.            (insert (substring (mymud-disp-var 'mymud-last-command)
  196.                               (match-beginning 1) (match-end 1)) " ")
  197.          (beep))))
  198.   (mymud-aa "Alas, you cannot go that way\\.\\.\\."
  199.             '((if (and mymud-last-command (mymud-directional mymud-last-command)) (setq mymud-where (mymud-add-dir-pd mymud-where (mymud-invert-dirs (list mymud-last-command))))) t))
  200.   (mymud-aa "\\*\\*\\* Press return \\*\\*\\*"
  201.             '((mymud-sendn "") (mymud-purger 0) t))
  202.   (mymud-aa " *\\*\\*\\* PRESS RETURN: *"
  203.             '((mymud-sendn "") (mymud-purger 0) t))
  204.   (mymud-aa "You are \\([0-9]* years\\) old\\."
  205.             '((setq mymud-character-age (mymud-matcher 1))
  206.               (mymud-purger 0) t))
  207.   (mymud-aa "You have \\([0-9]*\\)(\\([0-9]*\\)) hit, \\([0-9]*\\)(\\([0-9]*\\)) mana and \\([0-9]*\\)(\\([0-9]*\\)) movement points\\."
  208.             '((setq mymud-cur-hp (mymud-matcher 1)
  209.                     mymud-max-hp (mymud-matcher 2)
  210.                     mymud-cur-sp (mymud-matcher 3)
  211.                     mymud-max-sp (mymud-matcher 4)
  212.                     mymud-cur-mp (mymud-matcher 5)
  213.                     mymud-max-mp (mymud-matcher 6))
  214.               (mymud-purger 0) t))
  215.   (mymud-aa "You have scored \\([0-9]*\\) exp, and have \\([0-9]*\\) gold coins\\."
  216.             '((setq mymud-xp (mymud-matcher 1)
  217.                     mymud-gold (mymud-matcher 2))
  218.               (mymud-purger 0) t))
  219.   (mymud-aa "You have been playing for \\([A-Za-z0-9 ]*\\)\\."
  220.             '((setq mymud-age (mymud-matcher 1))
  221.               (mymud-purger 0) t))
  222.   (mymud-aa "This ranks you as \\(\\w*\\) the \\(\\w*\\) (level \\([0-9]*\\))\\."
  223.             '((setq mymud-name (mymud-matcher 1)
  224.                     mymud-title (mymud-matcher 2)
  225.                     mymud-level (mymud-matcher 3))
  226.               (mymud-purger 0) t))
  227.   (mymud-aa "You are standing\\."
  228.             '((setq mymud-position-status "standing")
  229.               (mymud-purger 0) t))
  230.   (mymud-aa "You stand up\\.\\|You stop resting, and stand up\\."
  231.             '((setq mymud-position-status "standing") t))
  232.   (mymud-aa "You are sitting\\."
  233.             '((setq mymud-position-status "sitting")
  234.               (mymud-purger 0) t))
  235.   (mymud-aa "You sit down\\."
  236.             '((setq mymud-position-status "sitting") t))
  237.   (mymud-aa "You go to sleep\\."
  238.             '((setq mymud-position-status "sleeping") t))
  239.   (mymud-aa "You are sleeping\\."
  240.             '((setq mymud-position-status "sleeping")
  241.               (mymud-purger 0) t))
  242.   (mymud-aa "You wake, and sit up\\."
  243.             '((setq mymud-position-status "sitting") t))
  244.   (mymud-aa "You rest your tired bones\\."
  245.             '((setq mymud-position-status "resting") t))
  246.   (mymud-aa "You are resting\\."
  247.             '((setq mymud-position-status "resting")
  248.               (mymud-purger 0) t))
  249.   ;You are now sober.
  250.   ;You are full
  251.   (mymud-aa "You are hungry\\."
  252.             '((setq mymud-hunger-status "hungry")
  253.               (mymud-purger 0) t))
  254.   (mymud-aa "You are thirsty\\."
  255.             '((setq mymud-thirst-status "thirsty")
  256.               (mymud-purger 0) t))
  257.   (mymud-aa "Brief mode on\\."
  258.             '((setq mymud-brief-status "Brief")
  259.               (mymud-purger 0) t))
  260.   (mymud-aa "Brief mode off\\."
  261.             '((setq mymud-brief-status "Verbose")
  262.               (mymud-purger 0) t))
  263.   (mymud-aa "You are hungry\\."
  264.             '((setq mymud-hunger-status "hungry")
  265.               (mymud-purger 0) t))
  266.   (mymud-aa "You are thirsty\\."
  267.             '((setq mymud-thirst-status "thirsty")
  268.               (mymud-purger 0) t))
  269.   ; For following:
  270.   (mymud-disp-make 'mymud-follow-person nil)
  271.   (mymud-set-key "\^c\^f" 'mymud-follow)
  272.   (mymud-aa "\\(The \\)?\\(\\w*\\) leaves \\(west\\|east\\|south\\|north\\|down\\|up\\|northwest\\|northeast\\|southwest\\|southeast\\)\\."
  273.             '((if (and mymud-follow-person
  274.                        (string= mymud-follow-person (mymud-matcher 1)))
  275.                   (cond
  276.                    ((string= (mymud-matcher 2) "west") (mymud-order "w"))
  277.                    ((string= (mymud-matcher 2) "east") (mymud-order "e"))
  278.                    ((string= (mymud-matcher 2) "north") (mymud-order "n"))
  279.                    ((string= (mymud-matcher 2) "south") (mymud-order "s"))
  280.                    ((string= (mymud-matcher 2) "down") (mymud-order "d"))
  281.                    ((string= (mymud-matcher 2) "up") (mymud-order "u"))
  282.                    ((string= (mymud-matcher 2) "northwest") (mymud-order "nw"))
  283.                    ((string= (mymud-matcher 2) "northeast") (mymud-order "ne"))
  284.                    ((string= (mymud-matcher 2) "southwest") (mymud-order "sw"))
  285.                    ((string= (mymud-matcher 2) "southeast") (mymud-order "se"))))
  286.               t))
  287.   (mymud-order "score")
  288.   (mymud-order "brief")
  289.   (mymud-order "brief")
  290.   )
  291.  
  292. (defun Lpmud-Setup () ; Rather complete
  293.   "Default setup function for all LPMUDs, either called directly or first command in the setup function for a specific LPMUD"
  294.   ; Setup for the variables which are useful in all LPMUDs (and only in them)
  295.   ; Name and Password should be overriden in the player-setup
  296.   ; The others need not the as they are automatically adjusted upon login
  297.   (mymud-set-key "\r" 'mymud-queue-command)
  298.   (mymud-set-key "\M-\r" 'mymud-send-command)
  299.   (mymud-disp-make 'mymud-name nil)
  300.   (mymud-disp-make 'mymud-password nil)
  301.   (mymud-disp-make 'mymud-title "beginner")
  302.   (mymud-disp-make 'mymud-drunk-status "Sober")
  303.   (mymud-disp-make 'mymud-brief-status "Verbose")
  304.   (mymud-disp-make 'mymud-wimpy-status "Brave")
  305.   (mymud-disp-make 'mymud-alignment "neutral")
  306.   (mymud-disp-make 'mymud-cur-hp "50")
  307.   (mymud-disp-make 'mymud-cur-sp "50")
  308.   (mymud-disp-make 'mymud-xp "0")
  309.   (mymud-disp-make 'mymud-gold "0")
  310.   (mymud-disp-make 'mymud-max-hp "50")
  311.   (mymud-disp-make 'mymud-max-sp "50")
  312.   (mymud-disp-make 'mymud-hunted-by nil)
  313.   (mymud-disp-make 'mymud-age "0 days 0 hours 0 minutes 0 seconds")
  314.   (mymud-disp-make 'mymud-last-location nil)
  315.   ; I like this mode-line-format although 80 columns usualy is a bit short for it
  316.   (mymud-disp-set 'mode-line-format '("" (mymud-queue "* " "  ") mymud-name "," mymud-title "(" mymud-alignment ") Hp:" mymud-cur-hp "/" mymud-max-hp " Sp:" mymud-cur-sp "/" mymud-max-sp " Gold:" mymud-gold " Xp:" mymud-xp " (" mymud-drunk-status "," mymud-wimpy-status "," mymud-brief-status ") "))
  317.   ; To spool out future commands
  318.   (mymud-aa "> "
  319.             '((cond
  320.                ((equal mymud-queue '()) )
  321.                ((equal mymud-queue 'last) (setq mymud-queue nil))
  322.                (t (mymud-command (car mymud-queue))
  323.                   (setq mymud-queue (cdr mymud-queue))))
  324.               (mymud-purger 0) t))
  325.   ; For following:
  326.   (mymud-disp-make 'mymud-follow-person nil)
  327.   (mymud-set-key "\^c\^f" 'mymud-follow)
  328.   (mymud-aa "\\(\\w*\\) leaves \\(west\\|east\\|south\\|north\\|down\\|up\\|northwest\\|northeast\\|southwest\\|southeast\\)\\."
  329.             '((if (and mymud-follow-person
  330.                        (string= mymud-follow-person (mymud-matcher 1)))
  331.                   (cond
  332.                    ((string= (mymud-matcher 2) "west") (mymud-order "w"))
  333.                    ((string= (mymud-matcher 2) "east") (mymud-order "e"))
  334.                    ((string= (mymud-matcher 2) "north") (mymud-order "n"))
  335.                    ((string= (mymud-matcher 2) "south") (mymud-order "s"))
  336.                    ((string= (mymud-matcher 2) "down") (mymud-order "d"))
  337.                    ((string= (mymud-matcher 2) "up") (mymud-order "u"))
  338.                    ((string= (mymud-matcher 2) "northwest") (mymud-order "nw"))
  339.                    ((string= (mymud-matcher 2) "northeast") (mymud-order "ne"))
  340.                    ((string= (mymud-matcher 2) "southwest") (mymud-order "sw"))
  341.                    ((string= (mymud-matcher 2) "southeast") (mymud-order "se"))))
  342.               t))
  343.   (mymud-aa "(just CR) " '((mymud-purger 0) (mymud-dispn "") t))
  344.   ;Kill those annoying controll sequences
  345.   (mymud-aa " ⁿ"
  346.             '((mymud-purger 0) (mymud-disp-set 'mymud-hide-output nil) t))
  347.   (mymud-aa " √"
  348.             '((mymud-purger 0) (mymud-disp-set 'mymud-hide-output t) t))
  349.   ; Short favorites from [c]lpmud.el
  350.   (mymud-short "fc" "from corpse ")
  351.   (mymud-short "fb" "from bag ")
  352.   (mymud-short "ib" "in bag ")
  353.   (mymud-short "gc" "get corpse ")
  354.   (mymud-short "dc" "drop corpse ")
  355.   (mymud-short "ec" "examine corpse ")
  356.   (mymud-short "sc" "search corpse ")
  357.   ; Just a neat little idea to show what you can do on one line (well, almost)
  358.   (mymud-short "it"
  359.      '((if (string-match "^\\w* \\w*.*$"
  360.                          (mymud-disp-var 'mymud-last-command))
  361.            (insert (substring (mymud-disp-var 'mymud-last-command)
  362.                               (match-beginning 1) (match-end 1)) " ")
  363.          (beep))))
  364.   (mymud-short "back" '((mymud-goto (mymud-disp-var 'mymud-last-location))))
  365.   (mymud-short "setback" '((mymud-disp-set 'mymud-last-location (mymud-disp-var 'mymud-where))))
  366.   ; These locations should be in most LPMUDs (needed for the auto-navigator)
  367.   (mymud-landmark "church" nil "Village church." "You are in the local village church.")
  368.   (mymud-landmark "pub" '("s" "e" "e" "n" "e") "The local pub." "You are in the local pub.")
  369.   (mymud-landmark "shop" '("s" "e" "e" "e" "n") "The shop." "You are in a shop. You can buy or sell things here.")
  370.   (mymud-landmark "post" '("s" "e" "e" "s" "s") "The post office." "This is the post office. If you want to send a mail to someone,")
  371.   (mymud-landmark "guild" '("s" "e" "e" "e" "s") "The adventurers guild." "You have to come here when you want to advance your level.")
  372.   (mymud-landmark "bank" '("s" "e" "e" "s" "e") "The bank." "You are in the bank.")
  373.   (mymud-landmark "clearing" '("s" "w" "w" "w" "w") "Clearing." "A small clearing. There are trees all around you.")
  374.   (mymud-aa "\\(What \\?\\|A strong magic force stops you\\.\\|Failed to load file\\.\\)"
  375.             '((if (and mymud-last-command (mymud-directional mymud-last-command)) (setq mymud-where (mymud-add-dir-pd mymud-where (mymud-invert-dirs (list mymud-last-command))))) t))
  376.   ; The following 3 are necessary for login (and get removed after being executed)
  377.   (mymud-aa "What is your name:" '((if mymud-name
  378.                                        (mymud-dispn mymud-name))
  379.                                      nil))
  380.   (mymud-aa "Password: $"
  381.             '((if mymud-password (mymud-sendn mymud-password)) nil))
  382.   (mymud-aa "Password: (just CR) $"
  383.             '((mymud-sendn "") (mymud-purger 0) nil))
  384.   (mymud-aa "Throw the other copy out *\\? " '((mymud-dispn "yes") nil))
  385.   ; Adjust the internal statuses of various modes
  386.   (mymud-aa "Brief mode\\."
  387.             '((setq mymud-brief-status "Brief") (mymud-purger 0) t))
  388.   (mymud-aa "Verbose mode\\."
  389.             '((setq mymud-brief-status "Verbose") (mymud-purger 0) t))
  390.   (mymud-aa "Wimpy = \\([0-9]*\\)% of \\(max\\|maximum\\) hit *points\\."
  391.             '((setq mymud-wimpy-status (concat "Wimpy " (mymud-matcher 1) "%"))
  392.               (mymud-purger 0) t))
  393.   (mymud-aa "Wimpy at \\([0-9]*\\) hit *points\\."
  394.             '((setq mymud-wimpy-status (concat "Wimpy " (mymud-matcher 1) " hp"))
  395.               (mymud-purger 0) t))
  396.   (mymud-aa "Wimpy mode\\."
  397.             '((setq mymud-wimpy-status "Wimpy") (mymud-purger 0) t))
  398.   (mymud-aa "Brave mode\\."
  399.             '((setq mymud-wimpy-status "Brave") (mymud-purger 0) t))
  400.   ; All possible ways to indicate drunkness/undrunkness
  401.   (mymud-aa "You no longer have a head *ache\\."
  402.             '((setq mymud-drunk-status "Sober") t))
  403.   (mymud-aa "Your head *ache disappears\\."
  404.             '((setq mymud-drunk-status "Drunk") t))
  405.   (mymud-aa "\\(A tingling feeling goes through your body\\|A shock wave runs through your body\\|That feels good\\).? *"
  406.             '((setq mymud-drunk-status "Drunk") t))
  407.   (mymud-aa "You \\(burp\\|feel drunk\\|stumble\\|hiccup\\)\\."
  408.             '((setq mymud-drunk-status "Drunk") (mymud-purger 0) t))
  409.   (mymud-aa "You are \\(roaring drunk\\|somewhat drunk\\|in a drun*ken stupor\\|quite tipsy\\|slightly tipsy\\)\\."
  410.             '((setq mymud-drunk-status "Drunk") (mymud-purger 0) t))
  411.   (mymud-aa "You suddenly without reason get a bad head *ache\\."
  412.             '((setq mymud-drunk-status "Headache") t))
  413.   ; Gag the GO player ! Similar lines ought to fit on Harry also
  414.   (mymud-aa "\\(The \\)?[Gg]o player says: .*" '((mymud-purger 0) t))
  415.   (mymud-aa "Harry says: .*" '((mymud-purger 0) t))
  416.   ; The next commands are there to adjust the internal values for the parameters
  417.   ; every time score is called. It is only tested on the World-of-Mizar and Alderon
  418.   ; so your regexps may vary
  419.   (mymud-aa "You are \\(\\w*\\) the \\([a-zA-Z? ]*\\) (\\(\\w*\\)) (level \\([0-9]*\\))\\."
  420.             '((setq mymud-title (mymud-matcher 2)
  421.                     mymud-alignment (mymud-matcher 3)
  422.                     mymud-name (mymud-matcher 1))
  423.               (mymud-purger 0) t))
  424.   (mymud-aa "You have \\([0-9]*\\) experience, \\([0-9]*\\) quest points, and \\([0-9]*\\) coins\\."
  425.             '((setq mymud-xp (mymud-matcher 1)
  426.                     mymud-gold (mymud-matcher 3))
  427.               (mymud-purger 0) t))
  428.   (mymud-aa "You are in an immaterial state with no scores\\."
  429.             '((setq mymud-title "Ghost")))
  430.   (mymud-aa "Health level: \\([0-9]*\\) hit points (of \\([0-9]*\\)), and \\([0-9]*\\) spell points\\."
  431.             '((setq mymud-cur-hp (mymud-matcher 1)
  432.                     mymud-max-hp (mymud-matcher 2)
  433.                     mymud-max-sp (mymud-matcher 2)
  434.                     mymud-cur-sp (mymud-matcher 3))
  435.               (mymud-purger 0) t))
  436.   (mymud-aa "You are \\(now \\)?hunted by \\(\\w*\\)\\."
  437.             '((setq mymud-hunted-by (mymud-matcher 1)) (mymud-purger 0) t))
  438.   (mymud-aa "You have \\([0-9]*\\) experience points, \\([0-9]*\\) gold coins, *"
  439.             '((setq mymud-xp (mymud-matcher 1)
  440.                     mymud-gold (mymud-matcher 2))
  441.               (mymud-purger 0) t))
  442.   (mymud-aa "\\([0-9]*\\) hit points(\\([0-9]*\\))\\."
  443.             '((setq mymud-cur-hp (mymud-matcher 1)
  444.                     mymud-max-hp (mymud-matcher 2)
  445.                     mymud-max-sp (mymud-matcher 2))
  446.               (mymud-purger 0) t))
  447.   (mymud-aa "\\([0-9]*\\) hit points (of \\([0-9]*\\)), and \\([0-9]*\\) spell points\\."
  448.             '((setq mymud-cur-hp (mymud-matcher 1)
  449.                     mymud-max-hp (mymud-matcher 2)
  450.                     mymud-max-sp (mymud-matcher 2)
  451.                     mymud-cur-sp (mymud-matcher 3))
  452.               (mymud-purger 0) t))
  453.   (mymud-aa "age: *\\(\\w[a-zA-Z0-9 ]*\\w\\)\\."
  454.             '((setq mymud-age (mymud-matcher 1)) (mymud-purger 0) t))
  455.   (mymud-aa "\\([0-9]*\\) spell points\\."
  456.             '((setq mymud-cur-sp (mymud-matcher 1))
  457.               (mymud-purger 0) t))
  458.   (mymud-aa "\\(\\w*\\) the \\([a-zA-Z0-9 ]*\\) (\\([a-zA-Z0-9 ]*\\))"
  459.             '((if (string= mymud-name (mymud-matcher 1))
  460.                   (setq mymud-title (mymud-matcher 2)
  461.                         mymud-alignment (mymud-matcher 3))) t))
  462.   (mymud-aa "You are intoxicated\\."
  463.             '((setq mymud-drunk-status "Drunk") (mymud-purger 0) t))
  464.   (mymud-aa "You are \\(completely \\)*sober\\."
  465.             '((if (not (string= mymud-drunk-status "Headache"))
  466.                   (setq mymud-drunk-status "Sober")) (mymud-purger 0) t))
  467.   ; Gold update commands
  468.   (mymud-aa "You get \\([0-9]*\\) gold coins\\."
  469.             '((setq mymud-gold (int-to-string (+ (string-to-int mymud-gold) (string-to-int (mymud-matcher 1))))) t))
  470.   (mymud-aa "[a-zA-Z ]*: *You get \\([0-9]*\\) gold coins\\."
  471.             '((setq mymud-gold (int-to-string (+ (string-to-int mymud-gold) (string-to-int (mymud-matcher 1))))) t))
  472.   (mymud-aa "[a-zA-Z ]* gives you \\([0-9]*\\) gold coins\\."
  473.             '((setq mymud-gold (int-to-string (+ (string-to-int mymud-gold) (string-to-int (mymud-matcher 1))))) t))
  474.   (mymud-aa "You drop \\([0-9]*\\) gold coins\\." 
  475.             '((setq mymud-gold (int-to-string (- (string-to-int mymud-gold) (string-to-int (mymud-matcher 1))))) t))
  476.   (mymud-aa "You pay \\([0-9]*\\) [a-zA-Z ]*\\."
  477.             '((setq mymud-gold (int-to-string (- (string-to-int mymud-gold) (string-to-int (mymud-matcher 1)))))))
  478.   ; First automatic commands to update your status
  479.   (mymud-order "score")
  480.   (mymud-order "brief")
  481.   (mymud-order "brief"))
  482.  
  483. (defun AfterHours-Setup ()
  484.   "An example setup for a specific LPMUD."
  485.   (Lpmud-Setup)
  486.   (mymud-disp-make 'mymud-level "0")
  487.   (mymud-disp-make 'mymud-race "human")
  488.   (mymud-disp-make 'mymud-class "adventurer")
  489.   (mymud-disp-make 'mymud-str "1")
  490.   (mymud-disp-make 'mymud-int "1")
  491.   (mymud-disp-make 'mymud-dex "1")
  492.   (mymud-disp-make 'mymud-con "1")
  493.   (mymud-aa "------------------------------------------------------------------"
  494.             '((mymud-purger 0) t))
  495.   (mymud-aa "\\(\\w*\\) the \\([a-zA-Z ]*\\) (\\([a-zA-Z ]*\\))"
  496.             '((if (string= (mymud-matcher 1) mymud-name)
  497.                   (progn
  498.                     (setq mymud-title (mymud-matcher 2))
  499.                     (setq mymud-alignment (mymud-matcher 3))
  500.                     (mymud-purger 0))) t))
  501.   (mymud-aa "Level *: *\\([0-9]*\\) *Gold Coins *: *\\([0-9]*\\) *"
  502.             '((setq mymud-level (mymud-matcher 1)
  503.                     mymud-gold (mymud-matcher 2))
  504.               (mymud-purger 0) t))
  505.   (mymud-aa "Maximum HP *: *\\([0-9]*\\) *Maximum SP *: *\\([0-9]*\\) *"
  506.             '((setq mymud-max-hp (mymud-matcher 1)
  507.                     mymud-max-sp (mymud-matcher 2))
  508.               (mymud-purger 0) t))
  509.   (mymud-aa "Current HP *: *\\([0-9]*\\) *Current SP *: *\\([0-9]*\\) *"
  510.             '((setq mymud-cur-hp (mymud-matcher 1)
  511.                     mymud-cur-sp (mymud-matcher 2))
  512.               (mymud-purger 0) t))
  513.   (mymud-aa "Experience *: *\\([0-9]*\\) *Next Level *: *\\([0-9]*\\) *"
  514.             '((setq mymud-xp (mymud-matcher 1))
  515.               (mymud-purger 0) t))
  516.   (mymud-aa "Race *: *\\([a-zA-Z ]*\\w\\) *Class *: *\\([a-zA-Z ]*\\w\\) *"
  517.             '((setq mymud-race (mymud-matcher 1)
  518.                     mymud-class (mymud-matcher 2))
  519.               (mymud-purger 0) t))
  520.   (mymud-aa "Str *: *\\([0-9]*\\) *Int *: *\\([0-9]*\\) *Dex *: *\\([0-9]*\\) *Con *: *\\([0-9]*\\) *"
  521.             '((setq mymud-str (mymud-matcher 1)
  522.                     mymud-int (mymud-matcher 2)
  523.                     mymud-dex (mymud-matcher 3)
  524.                     mymud-con (mymud-matcher 4))
  525.               (mymud-purger 0) t))
  526.   (mymud-aa "Age *: *\\([0-9a-zA-Z ]*\\)\\. *"
  527.             '((setq mymud-age (mymud-matcher 1))
  528.               (mymud-purger 0) t))
  529.   (mymud-aa "Your current hit points are \\([0-9]*\\)\\."
  530.             '((setq mymud-cur-hp (mymud-matcher 1))
  531.               (mymud-purger 0) t))
  532.   (mymud-aa "Your current spell points are \\([0-9]*\\)\\."
  533.             '((setq mymud-cur-sp (mymud-matcher 1))
  534.               (mymud-purger 0) t))
  535.   (mymud-aa "Also Healthy\\."
  536.             '((mymud-purger 0) t))
  537.   (mymud-aa "You are slightly tipsy\\."
  538.             '((mymud-purger 0) t))
  539.   (mymud-aa "You say: .*"
  540.             '((mymud-purger 0) t))
  541.   (mymud-landmark "bank" '("s" "e" "s") "The bank." "You are in the bank.")
  542.   (mymud-landmark "shop" '("s" "e" "n") "The shop." "You are in a shop.")
  543.   (mymud-landmark "inn" '("s" "e" "e" "n") "Village Inn." "You are in the Village Inn.")
  544.   (mymud-landmark "guild" '("s" "w" "s") "The adventurers guild." "You have to come here when you want to advance your level.")
  545.   (mymud-landmark "pub" '("s" "w" "w" "n") "The local pub." "You are in the local pub.")
  546.   (mymud-landmark "post" '("s" "w" "w" "s") "The Vision Post Office." "You are in the Vision post office.")
  547.   (mymud-landmark "smithy" '("s" "w" "w" "w" "n") "Smithy." "This is the town smithy.")
  548.   )
  549.  
  550. (defun Mizar-Setup ()
  551.   "An example setup for a specific LPMUD."
  552.   ; Always call the basic setup for the MUD-type first
  553.   (Lpmud-Setup)
  554.   ; An example landmark for the World of Mizar. Add many many many more
  555.   (mymud-landmark "temple" '("s" "e" "e" "e" "e" "n" "n" "n" "w" "w" "n" "n" "e") "Temple yard." "A yard in front of a huge temple, built in wood.")
  556.   (mymud-landmark "angmar" '("s" "w" "w" "s") "Angmar's castle." "You are inside the gates of Angmar the Necromancer's castle.")
  557.   (mymud-landmark "wreck" '("s" "e" "e" "e" "e" "e" "e" "e" "s" "s" "s" "w" "d") "Deck of wreck." "You're standing on the deck of on old ship")
  558.   ; The cow is worse than the GO player
  559.   (mymud-aa "The cow emits a lazy \"Moooooohh\""
  560.             '((mymud-purger 0) t))
  561.   (mymud-short "teleport" "cast teleport to ")
  562.   (mymud-short "whisper" "cast whisper ")
  563.   (mymud-short "dig" "cast dig")
  564.   (mymud-short "watcher" "cast summon watcher spirit")
  565.   (mymud-short "locate" "cast locate ")
  566.   (mymud-short "detect" "cast detect invisible")
  567.   (mymud-short "diagnose" "cast diagnose ")
  568.   (mymud-short "enlighten" "cast light")
  569.   (mymud-short "obscure" "cast obscure")
  570.   (mymud-order "who")
  571.   )
  572.  
  573. (defun Alderon-Setup ()
  574.   "An example setup for a specific LPMUD."
  575.   ; Always call the basic setup for the MUD-type first
  576.   (Lpmud-Setup)
  577.   (mymud-short "f" "flamestrike ")
  578.   (mymud-landmark "cave" '("s" "e" "e" "e" "e" "s" "s" "s" "s" "e" "e" "s" "s") "Closed Cave." "Closed Cave")
  579.   (mymud-landmark "grog" '("s" "w" "w" "w" "w" "n" "n" "w" "n" "n" "n" "w" "n") "Grog's magic shop." "You are in Grog's magic shop. Grog's voice says from nowhere")
  580.   (mymud-landmark "market" '("s" "e" "e" "e" "e" "n" "n" "n" "w" "w" "w") "Bracken Marketplace. " "This is the local Marketplace. ")
  581.   (mymud-landmark "inn" '("s" "e" "e" "e" "e" "n" "n" "n" "n" "n" "w") "Eastroad Inn." "You are in the Eastroad Inn. Here you can buy food to still your")
  582.   (mymud-landmark "giant" '("s" "w" "w" "w" "w" "n" "n" "n" "w" "w" "w") "Lair of the Giant." "There are mountains all around you.")
  583.   (mymud-landmark "aa" '("s" "w" "w" "w" "w" "n" "n" "w" "n" "n" "n" "w" "n" "n" "w" "w" "n"))
  584.   (mymud-landmark "knight" '("s" "w" "w" "w" "w" "s" "e" "u" "u" "u") "Fourth floor of the tower." "This is the fourth floor of the tower.  There is an")
  585.   (mymud-landmark "landing" '("s" "e" "s" "s" "s" "s" "s" "s") "A landing in stairway." "You are in a landing on the stairway, the stairway goes up")
  586.   (mymud-landmark "town" '("s" "e" "e" "e" "e" "n" "n" "n" "n" "n" "n" "n" "n" "w" "w" "n" "w" "w" "w" "w" "w") "A long road going through town.")
  587.   )
  588.  
  589. (defun Robot-Setup ()
  590.   "Not a setup for a specific mud. Rather call this to make a player a robot."
  591.   (mymud-disp-make 'mymud-master "")
  592.   (mymud-aa "\\(\\w*\\) says: \\([\\w*\\),\\(.*\\)"
  593.             '((if (and (string= (mymud-matcher 1) mymud-master)
  594.                        (string= (mymud-matcher 2) mymud-name))
  595.                   (mymud-robot-do (mymud-matcher 3))) t))
  596.   (mymud-aa "\\(\\w*\\) tells you: \\(.*\\)"
  597.             '((if (string= (mymud-matcher 1) mymud-master)
  598.                   (mymud-robot-do (mymud-matcher 2))) t))
  599.   (mymud-aa "\\(\\w*\\) whispers to you: \\(.*\\)"
  600.             '((if (string= (mymud-matcher 1) mymud-master)
  601.                   (mymud-robot-do (mymud-matcher 2))) t))
  602.   )
  603.  
  604. (defun mymud-robot-do (str)
  605.   (cond
  606.    ((string= str "report")
  607.     (mymud-order "score")
  608.     (mymud-order (concat "tell " mymud-master " HP:" mymud-cur-hp " Sp:" mymud-cur-sp " Gold:" mymud-gold " Loc:" (mapconcat '(lambda (str) str) mymud-where ",") )))
  609.    ((string= str "follow")
  610.     (mymud-follow mymud-master))
  611.    ((string= str "stop")
  612.     (mymud-follow ""))
  613.    (t (mymud-order str)))
  614.   )
  615.  
  616. (defun mymud (&optional name)
  617.   "Connect to a Mud."
  618.   ; Code stolen from a variety of MUD logins (and extensively remodelled)
  619.   (interactive)
  620.   (if (not name) (setq name (completing-read "Mud: " mymud-sites nil t)))
  621.   (let* ((sel (assoc name mymud-sites))
  622.          (site-hook (nth 3 sel))
  623.          (disp-buf (generate-new-buffer (concat "*" (car sel) "-display*")))
  624.          (comm-buf (generate-new-buffer (concat "*" (car sel) "*")))
  625.          (proc))
  626.     (condition-case err
  627.        (setq proc (open-network-stream (car sel) disp-buf (nth 1 sel) (nth 2 sel)))
  628.       (error (message "Error opening: %s" (prin1-to-string err))))
  629.     (set-process-filter proc 'mymud-filter)
  630.     (set-process-sentinel proc 'mymud-filter)
  631.     (switch-to-buffer disp-buf)
  632.     (mymud-disp-mode)
  633.     (if mymud-use-full-screen (delete-other-windows))
  634.     (select-window (split-window-vertically (- (window-height) mymud-command-window-height 1)))
  635.     (switch-to-buffer comm-buf)
  636.     (mymud-mode)
  637.     (run-hooks 'site-hook)
  638.     ))
  639.  
  640. (defun mymud-disp-mode ()
  641.   "Major mode for the display window in mymud-mode."
  642.   (interactive)
  643.   (kill-all-local-variables)
  644.   (setq mode-name "mymud-disp")
  645.   (setq major-mode 'mymud-disp-mode)
  646.   (setq buffer-read-only t)
  647.   (set-syntax-table text-mode-syntax-table)
  648.   (use-local-map (make-sparse-keymap))
  649.   (local-set-key "\^c\^b" 'mymud-balance-windows)
  650.   (local-set-key "\^c\^q" 'mymud-quit)
  651.   (make-local-variable 'mymud-queue)
  652.   (setq mymud-queue 'last)
  653.   (make-local-variable 'mymud-hide-output)
  654.   (setq mymud-hide-output nil)
  655.   (make-local-variable 'mymud-where)
  656.   (setq mymud-where nil)
  657.   (make-local-variable 'mymud-disp-buf)
  658.   (setq mymud-disp-buf disp-buf)
  659.   (make-local-variable 'mymud-comm-buf)
  660.   (setq mymud-comm-buf comm-buf)
  661.   (make-local-variable 'mymud-action-list)
  662.   (setq mymud-action-list nil)
  663.   (make-local-variable 'mymud-last-command)
  664.   (setq mymud-last-command nil)
  665.   (make-variable-buffer-local 'next-screen-context-lines)
  666.   (setq next-screen-context-lines 0)
  667.   (make-variable-buffer-local 'scroll-step)
  668.   (setq scroll-step 1)
  669.   (if mymud-debug (progn
  670.                     (make-local-variable 'mymud-debug-list)
  671.                     (setq mymud-debug-list nil)))
  672.   (goto-char (point-max)))
  673.  
  674. (defun mymud-mode ()
  675. "Major mode for the command window in Mymud.
  676. RET      mymud-send-command
  677.  will send the current line to the MUD server
  678. TAB      mymud-expand-short
  679.  will try to expand the previous word if it is an abbreviation
  680. C-c C-q  mymud-quit
  681.  will close all windows and kill all buffers associated with the current login
  682. C-c C-e  mymud-end-of-buffer
  683.  will scroll the display window to the end of the text
  684. C-c C-a  mymud-beginning-of-buffer
  685.  will scroll the display window to the beginning of the text
  686. C-c C-s  mymud-search
  687.  will interactively search backward through the display buffer
  688. C-c C-w  mymud-where
  689.  will display mymuds idea of where you are with respect to the starting location
  690.  in the message area.
  691. C-c C-b  mymud-balance-windows
  692.  will expand display and communications windows visible, expand, and move the
  693.  point to the communication buffer
  694. C-c C-d  mymud-toggle-debug
  695.  will toggle debugging mode. Don't use this unless you know what you are doing
  696.  
  697. For some types of MUD (LPMUD and some DikuMUD in particular) additional features
  698. are defined.
  699. RET      mymud-queue
  700.  will not send the current line immediately, put split it up into commands
  701.  separated by the value of the variable mymud-separator (usualy ';'). These
  702.  commands are then send in succession each time a prompt is received.
  703. ESC RET  mymud-send-command
  704.  will send the current line immediately and without parsing it. You have to
  705.  use this to respond to any questions preceded by anything but the standard
  706.  prompt (e.g. questions for the username, password a.s.o.)
  707. C-c C-f  mymud-follow
  708.  follow the creature with the given name around (Untested on DikuMUD)
  709. TAB      mymud-expand-short
  710.  will also recognize the name of locations common to all LPMUDs and landmarks
  711.  which have been entered for the particular MUD. Typing e.g. \"bank TAB\" will
  712.  expand to a sequence of commands which will move you to the bank. Just hit
  713.  return and you start moving (Untested on DikuMUD).
  714.  
  715. Many, many more neat features. Look at the code or simply try things to find
  716. out about them."
  717.   (interactive)
  718.   (kill-all-local-variables)
  719.   (setq mode-name "Mymud")
  720.   (setq major-mode 'mymud-mode)
  721.   (set-syntax-table text-mode-syntax-table)
  722.   (use-local-map (make-sparse-keymap))
  723.   (local-set-key "\^c\^q" 'mymud-quit)
  724.   (local-set-key "\^c\^e" 'mymud-end-of-buffer)
  725.   (local-set-key "\^c\^a" 'mymud-beginning-of-buffer)
  726.   (local-set-key "\^c\^s" 'mymud-search)
  727.   (local-set-key "\^c\^w" 'mymud-where-display)
  728.   (local-set-key "\^c\^b" 'mymud-balance-windows)
  729.   (local-set-key "\^c\^d" 'mymud-debug-toggle)
  730.   (local-set-key "\r" 'mymud-send-command)
  731.   (local-set-key "\C-i" 'mymud-expand-short)
  732.   (make-local-variable 'mymud-disp-buf)
  733.   (setq mymud-disp-buf disp-buf)
  734.   (make-local-variable 'mymud-comm-buf)
  735.   (setq mymud-comm-buf comm-buf)
  736.   (mymud-comm-make 'mymud-short-list nil)
  737.   (make-variable-buffer-local 'next-screen-context-lines)
  738.   (setq next-screen-context-lines 0)
  739.   (make-variable-buffer-local 'scroll-step)
  740.   (setq scroll-step 1))
  741.  
  742. (defun mymud-filter (proc string)
  743.   (save-excursion (let ((start) (l) (indent-tabs-mode nil))
  744.     (set-buffer (process-buffer proc))
  745.     (setq start (point-max))
  746.     (if mymud-debug (setq mymud-debug-list (cons string mymud-debug-list)))
  747.     (let ((buffer-read-only nil))
  748.       (goto-char start)
  749.       (insert string)
  750.       (goto-char start)
  751.       (while (search-forward "\^m" nil t) (delete-backward-char 1))
  752.       (goto-char start)
  753.       (while (search-forward "\^i" nil t)
  754.         (setq l (current-column))
  755.         (delete-backward-char 1)
  756.         (indent-to l))
  757.       (goto-char start)
  758.       (while (not (eq (point) (point-max)))
  759.         (if (looking-at " *$")
  760.             (if mymud-kill-empty-lines (kill-line 1) (forward-line 1))
  761.           (setq l mymud-action-list)
  762.           (while (and l (not (looking-at " *$")))
  763.             (if (and (car l) (looking-at (car (car l))))
  764.                 (if (not (eval (cons 'progn (car (cdr (car l))))))
  765.                     (setcar l nil)))
  766.             (setq l (cdr l)))
  767.           (if (looking-at "^ *$") (kill-line 1) (forward-line 1)))))
  768.     (mymud-end-of-buffer))))
  769.  
  770. (defun mymud-send (string)
  771.   "Send a string to the process associated with mymud-disp-buf"
  772.   (let ((proc (get-buffer-process mymud-disp-buf)))
  773.     (if proc (send-string proc string))))
  774.  
  775. (defun mymud-disp (string &optional prefix)
  776.   "Send a string to the process associated with mymud-disp-buf and print it in the display window"
  777.   (mymud-send string)
  778.   (save-excursion
  779.     (set-buffer mymud-disp-buf)
  780.     (goto-char (point-max))
  781.     (let ((buffer-read-only nil))
  782.       (if (not (mymud-disp-var 'mymud-hide-output))
  783.           (if prefix (insert prefix string) (insert string))))))
  784.  
  785. (defun mymud-sendn (string)
  786.  "Send string (with a newline added) to the process associated with mymud-disp-buf"
  787.  (mymud-send (concat string "\n")))
  788.  
  789. (defun mymud-dispn (string &optional prefix)
  790.   "Send string (with a newline added) to the process associated with mymud-disp-buf and print it in the display window"
  791.   (mymud-disp (concat string "\n") prefix))
  792.  
  793. (defun mymud-directional (str)
  794.   "Is this a direction command ? If so, return inverse, otherwise nil"
  795.   (cond
  796.    ((string= str "n") "s")
  797.    ((string= str "s") "n")
  798.    ((string= str "w") "e")
  799.    ((string= str "e") "w")
  800.    ((string= str "u") "d")
  801.    ((string= str "d") "u")
  802.    ((string= str "ne") "sw")
  803.    ((string= str "nw") "se")
  804.    ((string= str "sw") "ne")
  805.    ((string= str "se") "nw")
  806.    (t nil)))
  807.  
  808. (defun mymud-command (str)
  809.   "Send a command"
  810.   (if (mymud-directional str)
  811.       (mymud-disp-set 'mymud-where (mymud-add-dir-pd (mymud-disp-var 'mymud-where) (list str))))
  812.   (mymud-disp-set 'mymud-last-command str)
  813.   (mymud-dispn str mymud-prompt))
  814.  
  815. (defun mymud-quit ()
  816.   "Leave mymud-mode , kill all the processes, and close all the windows"
  817.   (interactive)
  818.   (let* ((disp mymud-disp-buf)
  819.          (comm mymud-comm-buf)
  820.          (proc (get-buffer-process disp)))
  821.     (if proc (delete-process proc))
  822.     (if disp (delete-windows-on disp))
  823.     (if comm (delete-windows-on comm))
  824.     (if disp (kill-buffer disp))
  825.     (if comm (kill-buffer comm))))
  826.  
  827. (defun mymud-end-of-buffer ()
  828.   "Jump to the end of the display buffer."
  829.   (interactive)
  830.   (let ((win (get-buffer-window mymud-disp-buf))
  831.         (swin (selected-window)))
  832.         (if win (save-excursion
  833.           (set-buffer mymud-disp-buf)
  834.           (goto-char (1- (point-max)))
  835.           (select-window win)
  836.           (recenter -1)
  837.           (select-window swin)))))
  838.  
  839. (defun mymud-beginning-of-buffer ()
  840.   "Jump to the beginning of the display buffer."
  841.   (interactive)
  842.   (let ((win (get-buffer-window mymud-disp-buf))
  843.         (swin (selected-window)))
  844.         (if win (save-excursion
  845.           (set-buffer mymud-disp-buf)
  846.           (select-window win)
  847.           (goto-char (point-min))
  848.           (recenter 1)
  849.           (select-window swin)))))
  850.  
  851. (defun mymud-search ()
  852.   "Isearch in the display buffer."
  853.   (interactive)
  854.   (let ((win (get-buffer-window mymud-disp-buf))
  855.         (swin (selected-window)))
  856.         (if win (save-excursion
  857.           (set-buffer mymud-disp-buf)
  858.           (select-window win)
  859.           (isearch-backward)
  860.           (recenter (/ (window-height win) 2))
  861.           (select-window swin)))))
  862.  
  863. (defun mymud-balance-windows ()
  864.   "Rebalance and display both display and communication buffer."
  865.   (interactive)
  866. ;  (if mymud-use-full-screen
  867.       (delete-other-windows)
  868. ;    (delete-windows-on mymud-disp-buf)
  869. ;    (delete-windows-on mymud-comm-buf))
  870.   (switch-to-buffer mymud-disp-buf)
  871.   (select-window (split-window-vertically (- (window-height) mymud-command-window-height 1)))
  872.   (switch-to-buffer mymud-comm-buf)
  873.   (mymud-end-of-buffer))
  874.  
  875. (defun mymud-debug-toggle ()
  876.   "Turn debugging on and off."
  877.   (interactive)
  878.   (if (mymud-disp-var 'mymud-debug)
  879.       (progn
  880.         (mymud-disp-set 'mymud-debug nil)
  881.         (insert (princ "Debug list:\n")
  882.                 (prin1-to-string (reverse (mymud-disp-var 'mymud-debug-list))))
  883.         (message "Mymud debug is off."))
  884.     (mymud-disp-make 'mymud-debug-list nil)
  885.     (mymud-disp-set 'mymud-debug t)
  886.     (message "Mymud debug is on.")))
  887.  
  888. (defun mymud-follow (whom)
  889.   "Start/Stop following a specific player."
  890.   (interactive "sFollow whom: ")
  891.   (if (string= whom "") (mymud-disp-set 'mymud-follow-person nil)
  892.     (mymud-disp-set 'mymud-follow-person whom)))
  893.  
  894. (defun mymud-where-display ()
  895.   "Display the path to the current location in the message line."
  896.   (interactive)
  897.   (message (concat "You are:" (mapconcat '(lambda (str) str) (mymud-disp-var 'mymud-where) mymud-separator))))
  898.  
  899. (defun mymud-queue-command ()
  900.   "Command to send as an order the current line."
  901.   (interactive)
  902.   (end-of-line)
  903.   (let ((end (point)) (beg))
  904.     (beginning-of-line)
  905.     (setq beg (point))
  906.     (mymud-order (buffer-substring beg end)))
  907.   (goto-char (point-max))
  908.   (if (not (looking-at "^$")) (insert-char ?\n 1)))
  909.  
  910. (defun mymud-send-command ()
  911.   "Command to send the current line."
  912.   (interactive)
  913.   (end-of-line)
  914.   (let ((end (point)) (beg))
  915.     (beginning-of-line)
  916.     (setq beg (point))
  917.     (mymud-dispn (buffer-substring beg end)))
  918.   (goto-char (point-max))
  919.   (if (not (looking-at "^$")) (insert-char ?\n 1)))
  920.  
  921. (defun mymud-order (str)
  922.   "Send (or queue) a possibly composite command."
  923.   (let ((cur) (quo (concat (regexp-quote mymud-separator) "\\|$" )))
  924.     (while (and (not (string= "" str)) (string-match quo str))
  925.       (setq cur (substring str 0 (match-beginning 0)))
  926.       (setq str (substring str (match-end 0)))
  927.       (cond
  928.        ((equal (mymud-disp-var 'mymud-queue) '())
  929.         (mymud-command cur)
  930.         (mymud-disp-set 'mymud-queue 'last))
  931.        ((equal (mymud-disp-var 'mymud-queue) 'last) 
  932.         (mymud-disp-set 'mymud-queue (list cur)))
  933.        (t 
  934.         (mymud-disp-set 'mymud-queue 
  935.                         (append (mymud-disp-var 'mymud-queue) (list cur))))))))
  936.  
  937. (defun mymud-aa (regexp elist)
  938.   "Most important customization routine. Whenever REGEXP appears the list of expressions ELIST is executed. If the elist returns t upon execution it will be executed again next time REGEXP appears. If it returns nil it is forgotten."
  939.   (mymud-disp-set 'mymud-action-list (append (mymud-disp-var 'mymud-action-list) (list (list regexp elist)))))
  940.  
  941. (defun mymud-delete-word-around-point ()
  942.   ; Stolen from the UNIX-interface routines by Wolfgang Rupprecht
  943.   ; (and slightly adapted)
  944.   "Return the word around the point as a string and kill it."
  945.   (save-excursion
  946.     (let ((beg) (str))
  947.       (if (not (looking-at "\\<"))
  948.       (forward-word -1))
  949.       (setq beg (point))
  950.       (forward-word 1)
  951.       (setq str (buffer-substring beg (point)))
  952.       (delete-region beg (point))
  953.       str)))
  954.  
  955. (defun mymud-expand-short ()
  956.   "Expand shorthands. Usually bound to TAB."
  957.   (interactive)
  958.   (let* ((li (mymud-comm-var 'mymud-short-list))
  959.          (word (mymud-delete-word-around-point))
  960.          (res (try-completion word li))
  961.          (all (all-completions word li)))
  962.     (cond
  963.      ((not all)
  964.       (insert word)
  965.       (beep))
  966.      ((assoc word li)
  967.       (mymud-execute-short word))
  968.      ((not (cdr all))
  969.       (mymud-execute-short (car all)))
  970.      (t
  971.       (insert res)))))
  972.  
  973. (defun mymud-landmark (short path &rest descs)
  974.   "This function does two things:
  975. First it sets up a shorthand with autonavigation to path
  976. Second it adds an action for every desc given which resets the
  977. mymud-where variable to path"
  978.   (mymud-short short (list (cons 'mymud-goto (list (cons 'quote (list path))))))
  979.   (if descs (mymud-aa (mapconcat 'regexp-quote descs "\\|") (list (cons 'setq (cons 'mymud-where (list (cons 'quote (list path))))) t))))
  980.  
  981. (defun mymud-goto (to)
  982.   "Use the auto-navigator to go from the current location to the location described by TO."
  983.   (interactive)
  984.   (mymud-disp-set 'mymud-last-location (mymud-disp-var 'mymud-where))
  985.   (setq to (mymud-sub-dir-pp to (mymud-disp-var 'mymud-where)))
  986.   (let ((domin (and (>= (length to) mymud-min-brief-length)
  987.                    (string= (mymud-disp-var 'mymud-brief-status) "Verbose"))))
  988.     (if domin (insert "brief" mymud-separator))
  989.     (while to
  990.       (insert (car to) mymud-separator)
  991.       (setq to (cdr to)))
  992.     (if domin (insert "brief" mymud-separator))))
  993.  
  994. (defun mymud-short (name &rest res)
  995.   "Add a shorthand NAME to mymud. If RES is a string, replace name by it. If RES is a list , execute it. If RES is nil, simply expand to full length."
  996.   (interactive)
  997.   (let ((ab (assoc name (mymud-comm-var 'mymud-short-list))))
  998.     (if ab
  999.         (setcdr ab res)
  1000.       (mymud-comm-set 'mymud-short-list (cons (cons name res) (mymud-comm-var 'mymud-short-list))))))
  1001.  
  1002. (defun mymud-execute-short (short)
  1003.   (setq short (assoc short mymud-short-list))
  1004.   (cond
  1005.    ((not short) (beep))
  1006.    ((not (cdr short)) (insert (car short)))
  1007.    ((stringp (car (cdr short))) (insert (car (cdr short))))
  1008.    ((listp (car (cdr short))) (eval (cons 'progn (car (cdr short)))))))
  1009.   
  1010. (defun mymud-purger (no)
  1011.   (delete-region (match-beginning no) (match-end no)))
  1012.  
  1013. (defun mymud-disp-var (sym)
  1014.   (save-excursion (set-buffer mymud-disp-buf) (eval sym)))
  1015.  
  1016. (defun mymud-comm-var (sym)
  1017.   (save-excursion (set-buffer mymud-comm-buf) (eval sym)))
  1018.  
  1019. (defun mymud-disp-set (sym val)
  1020.   (save-excursion (set-buffer mymud-disp-buf) (set sym val)))
  1021.  
  1022. (defun mymud-comm-set (sym val)
  1023.   (save-excursion (set-buffer mymud-comm-buf) (set sym val)))
  1024.  
  1025. (defun mymud-disp-make (sym val)
  1026.   (save-excursion (set-buffer mymud-disp-buf) (make-local-variable sym) (set sym val)))
  1027.  
  1028. (defun mymud-comm-make (sym val)
  1029.   (save-excursion (set-buffer mymud-comm-buf) (make-local-variable sym) (set sym val)))
  1030.  
  1031. (defun mymud-set-key (keys function)
  1032.   (save-excursion (set-buffer mymud-comm-buf) (local-set-key keys function)))
  1033.  
  1034. (defun mymud-matcher (no)
  1035.   (buffer-substring (match-beginning no) (match-end no)))
  1036.  
  1037. (defun mymud-invert-dirs (dir)
  1038.   (reverse (mapcar 'mymud-directional dir)))
  1039.  
  1040. (defun mymud-add-dir-pd (pos delta)
  1041.   (setq pos (mymud-invert-dirs pos))
  1042.   (while (and pos delta (string= (car pos) (car delta)))
  1043.     (setq pos (cdr pos) delta (cdr delta)))
  1044.   (append (mymud-invert-dirs pos) delta))
  1045.  
  1046. (defun mymud-sub-dir-pp (pos1 pos2)
  1047.   (while (and pos1 pos2 (string= (car pos1) (car pos2)))
  1048.     (setq pos1 (cdr pos1) pos2 (cdr pos2)))
  1049.   (append (mymud-invert-dirs pos2) pos1))
  1050.  
  1051. (defvar mymud-sites (append mymud-private-sites
  1052.   '(
  1053. ;;;
  1054. ;;;  NAME                   SITE                       PORT HOOK
  1055. ;;;
  1056.     ("AberMUD"             "a.cs.wvu.wvnet.edu"        6715 Abermud-Setup)
  1057.     ("AdaDUMII"            "legolas.cs.umu.se"         2001 nil)
  1058.     ("After Hours MUD"     "henson.cc.wwu.edu"         2000 AfterHours-Setup)
  1059.     ("Alderon"             "alderon.lanl.gov"          2000 Alderon-Setup)
  1060.     ("ArkMUD"              "engr.uark.edu"             6715 Tinymud-Setup)
  1061.     ("Asylum"              "uokmax.ecn.uoknor.edu"     6250 Tinymuck-Setup)
  1062.     ("BatMUD"              "batman.hut.fi"             2000 Lpmud-Setup)
  1063.     ("Bill and Ted's LPMud" "alicudi.usc.edu"          2010 Lpmud-Setup)
  1064.     ("Boiling MUD"         "frey.nu.oz.au"             2000 Lpmud-Setup)
  1065.     ("BotHaven"            "belch.berkeley.edu"        2323 Tinymud-Setup)
  1066.     ("Brigadoon"           "128.174.213.200"           4201 Tinymush-Setup)
  1067.     ("Butler MUD"          "butler.tds.kth.se"         6715 Tinymud-Setup)
  1068.     ("CAMUCK"              "flounder.berkeley.edu"     4201 Tinymush-Setup)
  1069.     ("Crossroads"          "civeng.ua.oz.au"           5505 Lpmud-Setup)
  1070.     ("Darker Realms"       "worf.tamu.edu"             2000 Lpmud-Setup)
  1071.     ("Dartmouth LPMud"     "wings.dartmouth.edu"       2000 Lpmud-Setup)
  1072.     ("DeathMUD"            "gauss.nmsu.edu"            2001 Lpmud-Setup)
  1073.     ("Deep Trouble"        "krikand.iesd.auc.dk"       2000 Lpmud-Setup)
  1074.     ("Desert Moon"         "alf.unomaha.edu"           1991 Lpmud-Setup)
  1075.     ("DikuMUD I(denmark)"  "alfa.me.chalmers.se"       4000 Dikumud-Setup)
  1076.     ("DikuMUD I(alaska)"   "hayes.ims.alaska.edu"      4000 Dikumud-Setup)
  1077.     ("DUM II"              "legolas.cs.umu.se"         2001 nil)
  1078.     ("DragonMud"           "naucse.cse.nau.edu"        4201 Tinymush-Setup)
  1079.     ("Eden"                "unicorn.cc.wwu.edu"        4201 Tinymush-Setup)
  1080.     ("End of the Line"     "mud.stanford.edu"          2010 Lpmud-Setup)
  1081.     ("FurryMUCK"           "hobbes.catt.ncsu.edu"      4242 Tinymuck-Setup)
  1082.     ("GenericMUD"          "natazhat.uafphysics.alaska.edu" 2000 Lpmud-Setup)
  1083.     ("Genesis"             "milou.cd.chalmers.se"      2000 Lpmud-Setup)
  1084.     ("GhostMUD"            "beowulf.acc.stolaf.edu"    6715 Lpmud-Setup)
  1085.     ("GooLand"             "rickers.cis.uoguelph.ca"   6715 nil)
  1086.     ("GraniteMUD"          "granite.wpi.edu"           2000 Lpmud-Setup)
  1087.     ("HackeMUD"            "bass.vsect.chalmers.se"      23 Abermud-Setup)
  1088.     ("IlliniMUD"           "ashley.cs.widener.edu"     6715 Abermud-Setup)
  1089.     ("Islandia II"         "apex.yorku.ca"             4201 Tinymud-Setup)
  1090.     ("JessMUD"             "dagon.acc.stolaf.edu"      6715 Abermud-Setup)
  1091.     ("KoBra-MUD"           "swisun5.swi.psy.uva.nl"    6666 Lpmud-Setup)
  1092.     ("Krynn"               "dante.cs.uiuc.edu"         2000 Lpmud-Setup)
  1093.     ("Lad Land"            "blob.hut.fi"               6715 Abermud-Setup)
  1094.     ("LambdaMOO"           "lambda.parc.xerox.com"     8888 nil)
  1095.     ("MauiMUD II"          "maui.cs.ucla.edu"          2000 Lpmud-Setup)
  1096.     ("MbongoMUCK"          "watpc13.ucr.edu"           4201 Tinymuck-Setup)
  1097.     ("MedMUCK"             "thesis2.hsch.utexas.edu"   7024 Tinymush-Setup)
  1098.     ("MicroMUSH"           "manray.csufresno.edu"      4201 Tinymush-Setup)
  1099.     ("Museum MUD"          "fuzine.mt.cs.cmu.edu"      4201 Tinymush-Setup)
  1100.     ("NLD MUD"             "chaos.utexas.edu"          2222 Lpmud-Setup)
  1101.     ("NannyMUD"            "nanny.lysator.liu.se"      2000 Lpmud-Setup)
  1102.     ("New Mud"             "192.75.19.1"               2000 Lpmud-Setup)
  1103.     ("Nightfall"           "taurus.tat.physik.uni-tuebingen.de" 2000 Lpmud-Setup)
  1104.     ("Pegasus"             "l_cae05.icaen.uiowa.edu"   2001 Tinymuck-Setup)
  1105.     ("PernMUSH"            "washington.andrew.cmu.edu" 4201 Tinymush-Setup)
  1106.     ("Phoenix"             "galjas.cs.vu.nl"           2000 Lpmud-Setup)
  1107.     ("QuantumMUCK"         "hewy.cs.byu.edu"           4201 Tinymuck-Setup)
  1108.     ("QuartzPARADISE"      "quartz.rutgers.edu"        9999 Tinymuck-Setup)
  1109.     ("Rebirth"             "uokmax.ecn.uoknor.edu"     2000 Lpmud-Setup)
  1110.     ("Renegade"            "sumter.cso.uiuc.edu"       3333 Lpmud-Setup)
  1111.     ("SeminoleMUD"         "systems.cc.fsu.edu"        6715 Abermud-Setup)
  1112.     ("Shadow World"        "elof.iit.edu"              2112 Lpmud-Setup)
  1113.     ("Sherlock's MUD"      "sherlock.geog.ucsb.edu"    2000 Lpmud-Setup)
  1114.     ("Small Systems"       "calvin.nmsu.edu"           2112 Lpmud-Setup)
  1115.     ("SqeaMUSH"            "ultimo.socs.uts.edu.au"    6699 Tinymush-Setup)
  1116.     ("Sun MUD"             "einstein.mpccl.ksu.edu"    2056 Lpmud-Setup)
  1117.     ("Temple U."           "monet.ocis.temple.edu"     6715 Tinymud-Setup)
  1118.     ("TempleMUD"           "bigboy.cis.temple.edu"     6715 Abermud-Setup)
  1119.     ("The Underground"     "hal.ai.mit.edu"            6715 Abermud-Setup)
  1120.     ("Thieve's World"      "uokmax.ecn.uoknor.edu"     2000 Lpmud-Setup)
  1121.     ("Third World"         "hardy.u.washington.edu"    2000 Lpmud-Setup)
  1122.     ("TigerMUCK"           "sun1.forestry.auburn.edu"  6250 Tinymush-Setup)
  1123.     ("Time Traveller"      "wookumz.ai.mit.edu"        4201 Tinymuck-Setup)
  1124.     ("TinyCWRU"            "dirac.ces.cwru.edu"        4201 Tinymush-Setup)
  1125.     ("TinyHORNS"           "bashful.cc.utexas.edu"     4201 Tinymuck-Setup)
  1126.     ("TinyMACH II"         "ernie.cs.byu.edu"          5464 Tinymuck-Setup)
  1127.     ("TinyMUD Classic"     "planck.physics.purdue.edu"  2323 Tinymush-Setup)
  1128.     ("TinyMUSH"            "manray.csufresno.edu"      2323 Tinymush-Setup)
  1129.     ("TinyTIM"             "grape.ecs.clarkson.edu"    6250 Tinymush-Setup)
  1130.     ("TinyWORLD"           "rillonia.ssc.gov"          6250 Tinymud-Setup)
  1131.     ("ToonMUSH"            "uokmax.ecn.uoknor.edu"     4835 Tinymush-Setup)
  1132.     ("U Maine LPMud"       "chevette.umcs.maine.edu"   2000 Lpmud-Setup)
  1133.     ("UCSB-GEOG"           "sherlock.geog.ucsb.edu"    2000 Lpmud-Setup)
  1134.     ("Underground"         "hal.ai.mit.edu"            6715 Tinymud-Setup)
  1135.     ("Vision"              "elof.iit.edu"              2222 Lpmud-Setup)
  1136.     ("Warhammer"           "watnxt3.ucr.edu"           2102 Lpmud-Setup)
  1137.     ("World of Mizar"      "Estel.DoCS.UU.SE"          9000 Mizar-Setup)
  1138.     ("Full Moon"           "matia.cs.wwu.edu"          2000 Lpmud-Setup)
  1139.     ("TinyMAGE"            "orca.micro.umn.edu"        4242 Tinymud-Setup)
  1140.     ("Vision II"           "buttermilk.princeton.edu"  2222 Lpmud-Setup)
  1141.     ("AlexMUD"             "alex.stacken.kth.se"       4000 Dikumud-Setup)
  1142.     )) "A list of mud-logins. Each login consists out a mud-name, a site-name, a port-number and a hook to call after login." )
  1143.