home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume18 / dunnet2 / part02 / dun-dos.el < prev    next >
Lisp/Scheme  |  1993-07-12  |  2KB  |  108 lines

  1. ;;;;;;;;;;;;;;;;;;;
  2. ;;;;
  3. ;;;; DOS
  4. ;;;;
  5. ;;;;;;;;;;;;;;;;;;;
  6.  
  7. (if nil
  8.     (eval-and-compile (setq byte-compile-warnings nil)))
  9.  
  10. (defun dos-parse (args)
  11.   (interactive "*p")
  12.   (beginning-of-line)
  13.   (let (beg)
  14.     (setq beg (+ (point) 3))
  15.     (end-of-line)
  16.     (if (not (= beg (point)))
  17.     (let (line)
  18.       (setq line (downcase (buffer-substring beg (point))))
  19.       (princ line)
  20.       (if (eq (parse2 nil dos-verbs line) -1)
  21.           (progn
  22.         (sleep-for 1)
  23.         (mprincl "Bad command or file name"))))
  24.       (goto-char (point-max))
  25.       (mprinc "\n"))
  26.     (if (eq dungeon-mode 'dos)
  27.     (progn
  28.       (fix-screen)
  29.       (dos-prompt)))))
  30.  
  31. (defun dos-interface ()
  32.   (dos-boot-msg)
  33.   (setq dungeon-mode 'dos)
  34.   (define-key dungeon-mode-map "\r" 'dos-parse)
  35.   (dos-prompt))
  36.  
  37. (defun dos-type (args)
  38.   (sleep-for 2)
  39.   (if (setq args (car args))
  40.       (if (string= args "foo.txt")
  41.       (dos-show-combination)
  42.     (if (string= args "command.com")
  43.         (mprincl "Cannot type binary files")
  44.       (mprinc "File not found - ")
  45.       (mprincl (upcase args))))
  46.     (mprincl "Must supply file name")))
  47.  
  48. (defun dos-invd (args)
  49.   (sleep-for 1)
  50.   (mprincl "Invalid drive specification"))
  51.  
  52. (defun dos-dir (args)
  53.   (sleep-for 1)
  54.   (if (or (not (setq args (car args))) (string= args "\\"))
  55.       (mprincl "
  56.  Volume in drive A is FOO        
  57.  Volume Serial Number is 1A16-08C9
  58.  Directory of A:\\
  59.  
  60. COMMAND  COM     47845 04-09-91   2:00a
  61. FOO      TXT        40 01-20-93   1:01a
  62.         2 file(s)      47845 bytes
  63.                      1065280 bytes free
  64. ")
  65.     (mprincl "
  66.  Volume in drive A is FOO        
  67.  Volume Serial Number is 1A16-08C9
  68.  Directory of A:\\
  69.  
  70. File not found")))
  71.  
  72.  
  73. (defun dos-prompt ()
  74.   (mprinc "A> "))
  75.  
  76. (defun dos-boot-msg ()
  77.   (sleep-for 3)
  78.   (mprinc "Current time is ")
  79.   (mprincl (substring (current-time-string) 12 20))
  80.   (mprinc "Enter new time: ")
  81.   (read-line)
  82.   (if (not batch-mode)
  83.       (mprinc "\n")))
  84.  
  85. (defun dos-spawn (args)
  86.   (sleep-for 1)
  87.   (mprincl "Cannot spawn subshell"))
  88.  
  89. (defun dos-exit (args)
  90.   (setq dungeon-mode 'dungeon)
  91.   (mprincl "\nYou power down the machine and step back.")
  92.   (define-key dungeon-mode-map "\r" 'dungeon-parse)
  93.   (if (not batch-mode)
  94.       (dungeon-messages)))
  95.  
  96. (defun dos-no-disk ()
  97.   (sleep-for 3)
  98.   (mprincl "Boot sector not found"))
  99.  
  100.  
  101. (defun dos-show-combination ()
  102.   (sleep-for 2)
  103.   (mprinc "\nThe combination is ")
  104.   (mprinc combination)
  105.   (mprinc ".\n"))
  106.  
  107. (defun dos-nil (args))
  108.